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

Home » Public Forums » archive » More WIN/UNIX -> MAC transitions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
More WIN/UNIX -> MAC transitions [message #21327] Tue, 22 August 2000 00:00 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Hello,

I have learned a couple of items worth sharing regarding our continuing
transition from UNIX/WIN to MAC.
Specifically, we have been wrestling with ASCII text data files
generated from a CTD device embedded in a Windows OS environ. Of
course the issue that surfaces is the carriage return/line feed (CRLF)
that is used in one envronment and not the others (and I can't remember
which does what... it doesn't matter really). Our files have an
complicated (messy) header followed by columnar data. Our interest is
in the header.

My hope is that by sharing what we've learned, someone will point us to
an even better solution.


We have come up with three solutions...

(1) Load the Win/DOS text format files onto a UNIX machine and use the
DOS2UNIX command:

unix> dos2unix -ascii infilename outfilename

This format is very clean for the MAC, too.

(2) Load the Win/DOS text format file into a Mac editior, like BBEdit
(www.barebones.com) and save in a Mac format.

This method is easy, but we have a bazillion of these files and I'm a
pretty poor show at piece work (too much daydreaming!)

(3) Use IDL to read the file and handle the extra control characters
internally.
We are using this method now because the enduser doesn't want to mess
around with exchanging files, etc. Since the header is relatively
small, there is little performance loss. In a nutshell we introduced a
test
for the contents of the most recent line read. If the line is emtpy
(meaning there was an extra linefeed or some-such-thing) then read the
next line. Here's a snippet...


.
.
.

ReadF,U, Input, Format='(A)'
If N_elements(Input) EQ 0 Then ReadF,U, Input, Format='(A)' ;check
for blanks
.
.
.

So, it works, even if a bit brutish. The most important thing, from
our standing, is that the enduser doesn't have to care a hoot about the
format of the file.


Ben

--
Ben Tupper
Bigelow Laboratory for Ocean Science
West Boothbay Harbor, Maine
btupper@bigelow.org
note: email address new as of 25JULY2000
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: contour filling maps
Next Topic: Re: idl 5.2 -> 5.3 problem: cw_form

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

Current Time: Wed Oct 08 13:33:56 PDT 2025

Total time taken to generate the page: 0.00416 seconds