Re: How to parse CSV
Re: How to parse CSV
- Subject: Re: How to parse CSV
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 21 Jan 2008 14:46:07 +0100
Le 21 janv. 2008 à 13:41, Skeeve a écrit :
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.
Clap hands !
I never understood why some one invented the CSV while the TSV is not
affected by the decimal separator in use.
A sample of the foolish aspect of CSV is given par Apple and
FileMaker which is a 100% Apple's subsidiary.
When used in French or in Deutsch, Apple's Numbers create CSV files
using the comma as field separator so it must enclose every decimal
number between quotes.
When used in French or in Deutsch, FileMaker's Bento create CSV files
using the semi-colon as field separator so decimal numbers don't need
to be enclosed.
And as a result, Bento is unable to import the CSV generated by Numbers
and
Numbers is unable to import the CSV denerated by Bento.
May I know to whom I must say Thank you ?
Yvan KOENIG _______________________________________________
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