August 24, 2006

[shell] sed replace to \n

Filed under: Programming — HanaDaddy @ 11:55 pm

sed is utility to replace particular text with new text in files.

s/// doesn’t work with \n
use y/// for \n replacement

sed 'y/ /\n/g'

Or you can use ‘tr’

$> tr -s '~' '\n' < inputfile > outputfile

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

 

43 queries. 0.841 seconds. Powered by WordPress