Re: Replace literal \n with newline

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Matt Graham
Date:  
To: plug-discuss
Subject: Re: Replace literal \n with newline
After a long battle with technology, David Bendit wrote:
> I'm trying to pull useful information out of a nessus report file (which
> is just XML), and everything works fine except the informational data
> portions. They're stored with string literal \n, and I can't figure out
> an easy way to convert those to actual newlines. With tr, the best I can
> get is removing all the n's


tr converts single chars to single chars, or deletes single chars. sed would
probably work. "sed -e 's/\\n/\n/g' < infile > outfile" will do what you
want, I think.

--
Life is a persistent hallucination, Death a mere illusion.
Taxes, however, are Objective Reality.
My blog and resume: http://crow202.dyndns.org:8080/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss