I have a CSV file that I want to import into a MySQL DB table. The file contains 15 fields. The able to import into will contain those same 15 fields, plus an auto-generated Primary Key fields.

Since this is the first time I'm working with mysqlimport, I created a small test table to start with - "simple1", containing two varchar fields - field1 and field2.

I'm trying to import a small test file into simple1, to get the hang of using mysqlimport. The test file contains 2 records and 3 lines - the 3rd line is blank:

"test1","test2"
"test11","test3"

I run the import as follows:
C:\Program Files\xampp\mysql\bin>mysqlimport.exe
--lines-terminated-by=\r --fields-terminated-by=, --local --user=root cars c:\dev\test\simple1.csv

The import report shows:   Records: 1  Deleted: 0  Skipped: 0 Warnings: 0

The data that ends up in the DB, however, only contains 1 record:
"\"test1\"","\"test2\"
\"test11\""

(1) how do I get mysqlimport to import both records, properly parsing the fields - two fields per record? (2) do I need to wrap the imported records in double-quotes? Why do the double-quotes show up in the MySQL DB table?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to