db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Kam" <moonblade.w...@gmail.com>
Subject CSV with fails with doublequote inside the value
Date Wed, 25 Jun 2008 10:59:21 GMT
Hello Apache Derby,

I'm using db-derby-, and when i'm importing a csv file like this

an error pops out like this :
*ERROR XIE0R: Import error on line 11 of file
/home/albert/mnt/linuxdb/rnd/sofco_sms/CSVs/sms_out.csv: Data found on line
11 for column 3 after the stop delimiter.
ERROR XIE03: Data found on line 11 for column 3 after the stop delimiter.
I check the file, and in the line 11, it goes like this :
"92","+628xxxxxxx","*Testinggg -__-"*","2006-08-03
(Notice the -__-"") the content should be *Testinggg -__-"*

So, i tried changing the *Testinggg -__-"* into *Testinggg -__-\"*, but
still errornous ..

Later after googling for a while, i found out about this :

Here's one interesting quote :

CSV as defined by RFC 4180 <http://tools.ietf.org/html/rfc4180> does not
"escape" double quotes with a backslash, but rather by an additional set of
double quotes. Your parser fails to handle this format properly.

CSV is hard.
Is this a bug or is it something that i did ? For now, i removed the
doublequotes and it worked like charm.

Albert Kam

Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

View raw message