Thanks, but quick question.  If I do it from the command line it works fine.  
But if I add:

`perl -pi -we 's/\n/\r\n/' ./student.csv`;

to my perl script it doesn't make the change to the file.  Is there a reason 
for this?

Robert 

Xavier Noria <[EMAIL PROTECTED]> wrote: 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/




       
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. 

Reply via email to