Hey Scott - I dont think you can use , with mysqlimport as a field separator if it is part of the data. use something else - I used the pipe | character...
This is what worked for me: C:\>mysqlimport --fields-enclosed-by=""" --fields-terminated-by=| --lines-terminated-by="\r\n" --ignore-lines=1 --user=root --password test c:\result.csv --verbose=TRUE --ignore=tr ue Enter password: **** Connecting to localhost Selecting database test Loading data from SERVER file: c:/result.csv into result test.result: Records: 7 Deleted: 0 Skipped: 0 Warnings: 0 Disconnecting from localhost C:\>type result.csv "48"| "14.729606"| "10.1.1.22"| "10.182.167.209"| "TCP"| "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" "48"| "14.729606"| "10.1.1.22"| "10.182.167.209"| "TCP"| "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" "48"| "14.729606"| "10.1.1.22"| "10.182.167.209"| "TCP"| "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" "48"| "14.729606"| "10.1.1.22"| "10.182.167.209"| "TCP"| "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" "48"| "14.729606"| "10.1.1.22"| "10.182.167.209"| "TCP"| "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" "48"| "14.729606"| "10.1.1.22"| "10.182.167.209"| "TCP"| "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" "48"| "14.729606"| "10.1.1.22"| "10.182.167.209"| "TCP"| "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" mysql> select info from result; +----------------------------------------------------------------+ | info | +----------------------------------------------------------------+ | "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" | | "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" | | "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" | | "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" | | "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" | | "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" | | "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" | +----------------------------------------------------------------+ 7 rows in set (0.00 sec) Let me know how it goes.. Anoop (anokun7) On 2/18/07, Scott Hamm <[EMAIL PROTECTED]> wrote:
I've been trying to import fields that contains the comma character ',' inside double quotes '"', with the results following: <code> mysqlimport --fields-optionally-enclosed-by=""" --fields-terminated-by=, --lines-terminated-by="\r\n" --ignore-lines=1 --user=root --password shark "c:\documents and settings\shamm\desktop\result.csv" Enter password: ********** mysqlimport: Error: Row 48 was truncated; it contained more data than there were input columns, when using table: result Line 48: "48", "14.729606", "10.1.1.22", "10.182.167.209", "TCP", "pop3 > 1111 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460" mysql> desc result; +-------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+------------------+------+-----+---------+-------+ | No | int(10) unsigned | NO | | | | | Time | text | NO | | | | | Source | text | NO | | | | | Destination | text | NO | | | | | Protocol | text | NO | | | | | Info | text | NO | | | | +-------------+------------------+------+-----+---------+-------+ 6 rows in set (0.03 sec) C:\Documents and Settings\shamm>mysql --version mysql Ver 14.12 Distrib 5.0.26, for Win32 (ia32) </code> -- -------------------------------------------------------------------- `Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. --------------------------------------------------------------------
-- Thanks and best regards, Anoop