At 4:44 PM +0900 5/28/01, jamal wrote:
>How to use MySQL LOAD DATA command to load comma separated text data
Huh? Your LOAD DATA statement below specifies |-separated data,
not comma-separated data.
>but one of the field can contains comma character as part of of the
>In other word, I want LOAD DATA insert string with comma characters
>inside it but without
>adding slash character ('\')to distinguish it as a field separator.
I may be missing something, but that doesn't appear to make sense.
If a comma is a field separator, then somehow you need to specify that
within-field commas are not separators, either by escaping them, or by
quoting the fields. Without using one of those mechanisms, MySQL has no
way to distinquish separator and non-separator commas.
>I use this command,
>LOAD DATA LOCAL INFILE "DATA.TXT" REPLACE INTO TABLE tbl
> FIELDS TERMINATED BY "|" IGNORE 1 LINES
>but when I look at the table tbl, everything is fine except
>in the field that contain comma character, comma charater is written
>as '\,' rather than just ','.
>What option of LOAD DATA should I use?
Paul DuBois, paul@stripped