Text Manipulation/Replacement

Hal Burgiss hal at burgiss.net
Tue Sep 23 00:25:50 UTC 2008


On Mon, Sep 22, 2008 at 05:22:43PM -0500, Chris Mohler wrote:
> Hmm - I've always had headaches dealing with newlines in sed and awk
> (to a lesser extent - I'm more familiar with sed).
> 
> How about perl?
> 
> cat foo.txt | perl -pi -e 's/\n//g'

cat foo.txt |tr -d \\n

is another option.

-- 
Hal
 




More information about the ubuntu-users mailing list