[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More WIN/UNIX -> MAC transitions
- Subject: More WIN/UNIX -> MAC transitions
- From: Ben Tupper <btupper(at)bigelow.org>
- Date: Tue, 22 Aug 2000 12:43:48 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: Bigelow Laboratory for Ocean Science
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:21006
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
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
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
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
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.
Bigelow Laboratory for Ocean Science
West Boothbay Harbor, Maine
note: email address new as of 25JULY2000