Productive Linux


 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Don't have an account?
Sign up to
Forgot your password?

Changing from double lf to single lf paragraphs
28 September 2006 @ 09:55 BST
by Paul

Here's something I find I often need to do in text files: change paragraph modes from lflf to a single lf and remove the single linefeeds from the line ends.

On the command line do:

perl -p -00 -e 'chomp; s/\n/ /g; $_ .= "\n" ' input-file.txt > output-file.txt

where input-file.txt and output-file.txt are your input and output files respectively.

Comments disabled