Re: Importing/parsing CSV files
Re: Importing/parsing CSV files
- Subject: Re: Importing/parsing CSV files
- From: Malcolm Fitzgerald <email@hidden>
- Date: Fri, 8 Sep 2006 16:02:58 +1000
I would not advise writing your own CSV parser
On 08/09/2006, at 12:56 AM, T&B wrote:
The need for one just keeps coming up, and now it's unavoidable. For
instance, I've needed it to import CSV data from on-line bank
statements, supplier price lists and on-line shopping carts, through
my scripts (which manipulate the data in other ways) into my own or
clients' AppleWorks or FileMaker or MYOB databases. I also need it for
a new database program I'm writing which uses SQLite, and takes data
from CSV, AppleWorks and other data sources.
If you are going to go ahead there are some givens, aren't there?
For instance,
each row must have a delimiter
each row must have the same number of columns
If the number of columns is less than expected then the next row must
be considered.
The existence of ," or ", in a row demands a corresponding closing quote
also, the parser doesn't have to be universally capable in the first
version (does it?), so you'll get some free kicks, for instance, the
first column of your data may contain an id with a distinct format. So
that is effectively the row delimiter.
malcolm
_______________________________________________
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