i did much the same thing in perl
  (see attached)
i'm not a mac fan
so i called it "antimac" :)

it should take a file that's been polluted with mac carraige-returns (\r in
perl) and replace it all with (\n)'s.

_________________________________
daniel a. g. quinn
starving programmer

the more law and order are made prominent,
the more thieves and robbers there will be.
 - lao-tsu




----- Original Message -----
Sent: Friday, September 06, 2002 11:35 AM
Subject: Re: More on apples text files


| In <[EMAIL PROTECTED]>, on
| 09/06/2002 at 09:48 AM,
|    Blake Thornton <[EMAIL PROTECTED]> said:
|
| >I'm running into problems with sharing text files between macs and my
| >linux machine.  The problem seems to be that on linux my text files have
| >end of lines (\n) and on the mac text files have something else (shown as
| > '^M' when I look at it in Linux).  Maybe there are other problems too,
| >but  this seems to be one.  Anyone run into this before and found a
| >solution?
|
| Unix uses linefeeds at the end of each line.  Macs use a carriage return
| at the end of each line.  DOS and its derivatives use a carriage
| return-linefeed pair.
|
| The ^M is the the <CR> from the Mac.  You'll see that with DOS files too.
|
| To switch back and forth between DOS and Unix there are a set of utilities
| (dos2unix and unix2dos) that will fix these up for you.  I have around
| here (somewhere) a script that I found on the net somewhere called
| mac2unix that converts the <CR>s to <LF>s.  Don't know about going the
| other way, should be able to rewrite the script to do that.
|
|
|
| --
| -----------------------------------------------------------
| Steve Garcia   using MR/2 ICE #10133 with Warp 4
| [EMAIL PROTECTED]
| For PGP key, send mail to [EMAIL PROTECTED] with subject "PGP key"
| -----------------------------------------------------------
| The Operating System/2 Version is 4.50
| Revision 14.062
| There are 38 Processes with 138 Threads.
| GHARLANE: uptime is 0 days, 03:42 hours and 33 seconds
|
| *  They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- Benjamin Franklin
|
|
|
| --
| redhat-list mailing list
| unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
| https://listman.redhat.com/mailman/listinfo/redhat-list
|

Attachment: antimac.pl
Description: Binary data

Reply via email to