Web Hosting Info

Search:

featured partner

The IP to Country Database

  Forum Topics : Support / error in CSV file ? why not make it a TXT instead ?
Submitted by djit on Sat, 12/27/2003 - 17:42.
hello !

i'm trying to stuff the .csv file into my mySQL database, which does not allow the 'used' command.
therefore i used an import script, which seems to work fine.
Yet i get a mySQL error message at the moment of inserting the content:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '33996344", """33996351""", """GB""", """GBR""", """UNITED KINGD

I opened the .csv file and it seems odd to me, (but i'm not an expert so i expect to be wrong) that all the fields content are in one excell column, and not one column for each field. Also, doublequote signs are oddly organised:

33996344,"33996351","GB","GBR","UNITED KINGDOM"

whereas i would expect it to be inserted like this:
"33996344","33996351","GB","GBR","UNITED KINGDOM"

Could you please confirm how should the typical row look like? I will then transform the .csv into a txt file according to your answer.

PS: I am wondering why do you make it a .csv file and not a .txt file? would it be possible for you to do both? When i see how much postings are related to inserting csv into mySQL, i wonder if it wouldn't save you the time of answering these ;-)

Thanks a lot,

Alexandre
Comment viewing options:
Select your preferred way to display the comments and click 'Save settings' to submit your changes.
Hi djit ! A CSV (comma-sep
Posted by amit on Sun, 12/28/2003 - 20:52.
Hi djit !

A CSV (comma-separated values) file contains the values in a table as a series of ASCII text lines organized so that each column value is separated by a comma from the next column's value and each row starts a new line.
eg.
"33996344","33996351","GB","GBR","UNITED KINGDOM"

I was pretty surprised by seeing the CSV format that you had pasted
i.e 33996344,"33996351","GB","GBR","UNITED KINGDOM"
such a format does not exists in your csv file...

You have probably messed up the file in some way while trying to import it
Please refer to Our handbook section for importing the CSV file..

-
Amit Bhawnani
another humble employee.
 
CSV format
Posted by djit on Mon, 12/29/2003 - 05:23.
Hello Amit, thanks a lot for your reply.

you say:
I was pretty surprised by seeing the CSV format that you had pasted
i.e 33996344,"33996351","GB","GBR","UNITED KINGDOM"
such a format does not exists in your csv file...

IT's actually how it looks when i open the downloaded csv file, with MS excell 2003. And it's exactly the same with the new december version.

??

Do i have to modify the whole file so that it matches the format
"33996344","33996351","GB","GBR","UNITED KINGDOM"

??

have a good day

*-]

djit



_________________________
http://www.lab-au.com
 
Hi djit ! Can u open the
Posted by amit on Mon, 12/29/2003 - 20:30.
Hi djit !

Can u open the CSV file is a normal text editor like notepad and tell me if the format looks alright ?

-
Amit Bhawnani
another humble employee.
 
Excel...
Posted by martin palmieri on Mon, 01/05/2004 - 05:38.
It's probably Excel that is messing up the formating.
Try to open it with a text editor.

Cheers
Martin