On Aug 25, 2007, at 4:54 AM, Yoyoyo Yoyoyoyo wrote:

I use a mac and I was wondering if there was a way to convert unix newlines in a text file to dos newlines.

Yeah, with a Perl one-liner it would be

  perl -pi -we 's/\n/\r\n/' file.txt

or

  perl -pi.bak -we 's/\n/\r\n/' file.txt

if you want a backup of the original file.

-- fxn

PS: For the archives, note those solutions assume the runtime platform is Unix.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to