-   Programming (
-   -   Join all lines using sed (

chipix 07-20-2004 09:02 AM

Join all lines using sed

what is the proper sed command in order to transform a multi-line file to a single line. For example:

mplampla mpla 3

mpla1 mpla2 mplampla mpla 3


Hko 07-20-2004 09:24 AM

Read this thread:

chipix 07-20-2004 09:32 AM

Oh thx.

I did not know that my question was already answered. :rolleyes:

However, I found also this solution:

tr?? man, unix has a lot of commands!!:study:

sredden79 04-03-2007 09:55 AM

to spell this out for everyone the command you need to use to remove all the new line characters using sed is :

sed -e :a -e '$!N; s/\n/ /; ta' test.txt

hope this helps.

All times are GMT -5. The time now is 10:17 AM.