in reply to Making my file all one line
Here are some variations:perl -00 -pe 's/ $/\012/ if s/\n+/ /g and eof' file
Choose eof or eof() to get the desired effect when dealing with multiple files.perl -00 -pe '(eof) ? s/\n\n/\n/ : s/\n+/ /g ' file perl -00 -pe 's/\n+/(eof) ? "\n" : " "/eg ' file
--
John.
|
|---|