Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: text files from mac

by ryantate (Friar)
on Apr 13, 2005 at 20:25 UTC ( [id://447577]=note: print w/replies, xml ) Need Help??


in reply to text files from mac

Your script looks like it would work fine if it were fed pure Mac OS 9 or earlier text. Probably what's happening is you are dealing with text from Mac OS X, which has unix-style newlines, with \015 (\f) as the newline (not \r, which is \012, and was the traditional Mac newline before OS X). This will result in a square when reading on a Windows machine because it does not recognize \015 as a newline at all.

The actual newlines in your output come not from the original file but from your printing "\n" in the while loop, since \n is the "logical newline" for your system, in your case Windows, and thus generates the correct \012\015 sequence.

PS If I am correct about your using Mac OS X files then simply changing $/ to "\015" (untested and not sure if I have the syntax right) should solve your problem.

Replies are listed 'Best First'.
Re^2: text files from mac
by Anonymous Monk on Apr 20, 2005 at 12:55 UTC
    ta! the first too snippets give the same output as my code prompting me to think that there is some other problem like corrupted disk/data the machine isn't OS X though was the first thing i checked coz its the only kind of mac i know anything about (and then the only thing i no is that its basically UNIX) i was hoping to ftp the beasts to my LINUX machine and then no problem but alas this wasn't the case

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://447577]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found