comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: reading a Mac text file on Windows
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: reading a Mac text file on Windows [message #20299] Fri, 02 June 2000 00:00
Paul Woodford is currently offline  Paul Woodford
Messages: 43
Registered: June 2000
Member
In article <8h67q1$85s$1@nnrp1.deja.com>, Ronn Kling <ronn@rlkling.com>
wrote:

> I have an ascii text file that was created on a Mac that now resides on
> Windows. I need to be able to read this into IDL on Windows, but so far
> I have had no luck. (On a Mac the end of line is a linefeed, on Windows
> it is a carriage return/line feed. On Windows, IDL thinks this is a one
> line file). I would like some IDL technique to read this, but if
> someone has some C code that can do it I would be interested.

In addition to David Fanning's suggestions:

* Use BBEdit as your editor on the Mac. BBEdit and its freeware
version, BBEdit Lite, can transparently handle Mac, DOS, and unix end of
line conventions. I work with all three platforms, and have found that
using the unix convention is best. IDL on all three platforms seems to
understand unix convention.

* A number of Mac utilities exist that translate between the different
conventions. I use DropStrip if I want to convert a whole folder of
files, for instance.
--
Paul Woodford, Ph.D.
Essex Corporation

For faster email response, replace "us.net" with "essexcorp.com"
Re: reading a Mac text file on Windows [message #20315 is a reply to message #20299] Thu, 01 June 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ronn Kling (ronn@rlkling.com) writes:

> I have an ascii text file that was created on a Mac that now resides on
> Windows. I need to be able to read this into IDL on Windows, but so far
> I have had no luck. (On a Mac the end of line is a linefeed, on Windows
> it is a carriage return/line feed. On Windows, IDL thinks this is a one
> line file). I would like some IDL technique to read this, but if
> someone has some C code that can do it I would be interested.

I'm sure some Mac guy will have better advice than this,
but if you can't do the translation from Mac to PC format
when you transfer the file (e.g. your FTP application will
often do it automatically for you) then I don't think you
have a lot of options in IDL except to read one huge line
(usually as a byte array, since anything else is too small)
and parse it.

But I've had good luck opening files like this in some
kind of reasonably intelligent text editor. I like Notetab,
a wonderful freeware editor written my Eric Fookes
(http://www.unige.ch/sciences/terre/geologie/fookes/).
The "professional" version is all of $5, which I was only
too happy to fork over. :-)

Hitting a couple of option switches soon gets the file
in the format you hoped it would be in, you re-save it,
and you are good to go. Not elegant, perhaps, but it
sure beats scratching your head and and spending two
hours working something out in IDL. (Unless, of course,
the clock is running on a consulting project. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Curvefit on PV-Wave
Next Topic: Color printing to a Lexmark printer

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:56:32 PDT 2025

Total time taken to generate the page: 0.00571 seconds