Home replacing-comma-with-newline
Post
Cancel

replacing-comma-with-newline

use the ‘\r’ combo instead of ‘\n’

hostname,hostalias,hostaddress,hoststate :%s/,/\r/g

hostname hostalias hostaddress hoststate

To go back the other way, use ‘\n’ instead of ‘\r’..weird

:%s/\n/,/g

This post is licensed under CC BY 4.0 by the author.