Re: How to parse CSV
Re: How to parse CSV
- Subject: Re: How to parse CSV
- From: Skeeve <email@hidden>
- Date: Mon, 21 Jan 2008 13:41:43 +0100
Benedikt Quirmbach wrote:
What I need:
0. A reliable way to get the data from you customers. CSV isn't a
format, CSV is a diseaese
There are several flaws in the design of CSV
1. CSV has no design. It is an ad-hoc "format"
2. How to handle texts?
a) surround with "
b) surround with '
c) don't surround
3) How to handle " and '
a) double them
b) escape with \
4) How to handle the field seperator
a) Forbid in texts
b) Text MUST be surrounded by " or '
5) How to handle numbers
a) . or
b) , as decimal seperator
c) If , what is the field seperator?
6) How to handle dates
a) American notation?
b) ISO notation
c) "German" notation
7) Which charset to use
8) Which linefeed to use
And I'm sure this is not everything about it...
Usually CSV/TSV is okay if you get the data in a consistant format from
ALL your customers. Otherwise it's a nightmare.
Switch to something more reliable like
a) XML
b) SLK (or SYLK)
Having said that, you might either take the SMILE-approach or lets
discuss (off the list in german) how to utilize perl for this. ;-)
-- Skeeve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden