Remove Line Feed Characters from text file

Bill Campbell bill at celestial.com
Mon Jan 12 17:30:19 PST 2009


On Mon, Jan 12, 2009, Scott Walker wrote:
>
>   Please remind me of the way to remove "0a" line feed characters from a
>   text file.  I don't want to replace them with anything, just remove
>   them.
>

In Linux/Unix systems, the newline character is the basic line
separator, and the resulting file with then be one long line.

A perl one-liner that will do this is:

perl -e 'while(<>) {chomp; print;}' < infile > outfile

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

It is error alone which needs the support of government.
Truth can stand by itself. -- Thomas Jefferson


More information about the Filepro-list mailing list