Thursday, December 9, 2010

how to join lines in a file in Linux?

With tr command
1) tr "\n" " " < filename
2)cat filename | tr -d "\n"
3)cat filename | tr "\n" " "

With paste command


paste -s -d " " filename


if you people have more comment on this..

Enhanced by Zemanta

0 comments:

Post a Comment