[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: a quickie



Reply to the list and not to me, I am on the list.

Rob Mahurin <rob@utk.edu> [2002-09-11 23:09:08 -0400]:
> Copy to me, I'm not on the list.  Thanks,
> What's the perl command to convert a text file from DOS or unix
> newline format to the macintosh newline format?  (CR->LF?)

You know you could google for that information probably quicker.  But
I am a sucker for those types of questions...  Does it have need to be
perl?  These are off of the top of my head and there may be mistakes
here.  YMMV, etc., etc.

MAC to UNIX:

  tr "\015" "\012" < uxfile > macfile

UNIX to MAC:

  tr "\012" "\015" < uxfile > macfile

DOS to UNIX:

  tr -d "\015" < dosfile > uxfile

UNIX to DOS:

  perl -ne 'print "$_\r"' < uxfile > dosfile

Bob

Attachment: pgpYEbyGch4hu.pgp
Description: PGP signature


Reply to: