http://qs1969.pair.com?node_id=132406

Perl one-liner to add HTML break to each line of a text file.   Single quotes shown are for *nix, use double quotes for Win32.

Thanks to monks (I forget who) who helped me in the CB months ago on this.   With grinder's Perl Monks Snippets Index now active at jcwren's perlmonk.org host, this seems worth posting.



perl -pe 's/^(?!(<p>|<br>))/<br>/gi;' < original_file > new_file