Return to Snippet

Revision: 7536
at July 29, 2008 03:17 by retry


Initial Code
$ perl -i.bak -pe 'chomp; print " ";' gear_list.xml

Initial URL
http://forums.macosxhints.com/showpost.php?s=5db608600334b1707729f707eed4c7ca&p=459362&postcount=3

Initial Description
This Perl one-liner will remove all newline characters from a text file, replacing them with a space.  In the source, all newline characters in the file gear_list.xml are replaced with spaces, and the original file is saved as gear_list.xml.bak

Initial Title
Remove newline characters from text

Initial Tags
text, perl

Initial Language
Perl