PDA

View Full Version : import csv



Jenny
02-17-2007, 04:36 PM
Hi,

I would like to import a csv into a db that already contains data (without destroying that data).

I am given some CSV options in phpMyAdmin and need some advice.

Do I leave the column names field blank? Also, it says the fields are searated by ; but surely the whole point of CSV is that fields are separated by , or is that wrong?

Jenny
02-17-2007, 04:49 PM
Also, if one of the fields is "auto-increment" (the id field), then do I leave the id field out of the CSV file that I am importing?

Karen Mac
02-17-2007, 04:54 PM
Jenny

It would depend on what kind of database you are uploading to. CSV can also be seperated by the semi colon. Usually you can tell it that the top row is titles or headers and to create or skip the first row.

If you are uploading to some sort of storebuilder I suggest you make your categories, and add one or two products, then download that file, and then format your new file to match it. Fewer headaches that way all the way around.

Karen

davidundalicia
02-17-2007, 07:41 PM
If you are importing to a Mysql database then you have the option of changing the default (;) to a (,)

Leave the auto increment field out

If I were you, I would copy the table first and then import a single record/line first and then review the result.

You can always delete any records that you import anyway.