Replace Line Feed with a Space in unix shell script -


i have text file containing records. each record splitted in 4 rows (not 4), example:

---- row1 row2 row3 row4 ---- row1 etc... 

each row ended line feed character (lf). ok, need obtain record in 1 line, replacing lf character space, in example:

---- row1 row2 row3 row4 ---- row1 row2 ...etcetera 

any or suggestion solution? in advance.

maybe can work ?

cat file | xargs | sed "s/ ---- /\n---- /g" 

Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -