List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 30 2001 3:09am
Subject:Re: What option of LOAD DATA should I use?
View as plain text  
At 4:44 PM +0900 5/28/01, jamal wrote:
>Hi all,
>
>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 
>string context.?
>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?
>
>Jamal


-- 
Paul DuBois, paul@stripped
Thread
What option of LOAD DATA should I use?jamal28 May
  • Re: What option of LOAD DATA should I use?Paul DuBois30 May
  • Re: What option of LOAD DATA should I use?jamal30 May