Re: Importing/parsing CSV files
Re: Importing/parsing CSV files
- Subject: Re: Importing/parsing CSV files
- From: Doug McNutt <email@hidden>
- Date: Fri, 8 Sep 2006 10:23:15 -0600
At 09:25 -0400 9/8/06, Mark J. Reed wrote:
>On 9/8/06, Malcolm Fitzgerald <<mailto:email@hidden>email@hidden> wrote:
> >> each row must have a delimiter
>Not if there's only one value in that row.
Huh? How did you know that the row ever started? Was it preceded by its required delimiter?
Or is the "one value" really the first in the next row?
>Nope. Newline outside of quotation marks terminates the row always.
But apparently something else can terminate a row as per the above. What?
> >> The existence of ," or ", in a row demands a corresponding closing quote
>...which may be on the next line because of an embedded newline.
And just how does that depend on which newline character(s) we're talking about? There are three ASCII newline conventions and two more in the world of unicode not to mention \n\r which is still around in some teletype-like equipment.
Must an embedded newline be in the correct style for the processing software? Should FTP and the like muck with embedded newlines to apply to the machine in use? I can certainly imagine a specification that uses \r for embedded newlines and \n for "real" lineends in the TEXT file. In fact Filemaker once gave me fits with some other ASCII control character it uses to delimit lines in a single storage field.
I'm all in favor of a real definition of just what a *.csv file is but I suspect it will not come from AppleScript. Here are a three that all have differing "standards".
<http://www.edoceo.com/utilis/csv-file-format.php>
<http://www.rfc-editor.org/rfc/rfc4180.txt>
>While numerous private specifications exist for various programs and systems, there is no single "master" specification for this format.
<http://www.hmug.org/man/n/csv.php>
If ever an AppleScript procedure is standardized I suggest the name AppleBabble. I shall continue to write my own decoder for each known source, be it a bank, a spreadsheet, or an oscilloscope.
--
Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden