Can LOAD DATA ignorecharacters normally needing escapes inside fields?
DaveO <[email protected]> Sat, 21 Apr 2007 12:56:20 -0500
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Message-ID | <[email protected]> |
A windows platform application generates a file consisting of comma separated text whose fields are enclosed in double quotes. When executing the load data infile command, the backslash characters in field "path" cause problems. There isn't a way to have the windows application generate escaped backslashes, i.e. \\. I suppose I could make a separate pass through the text file doing a text substitution, but I'd prefer to avoid that. Is there a way to have LOAD DATA INFILE not pay attention to the contents of a field when loading it? The data consists of many lines of the form: "abc","dir1\dir2\dir3","file.ext","xyz" and my sql statement is like: TRUNCATE TABLE table_name; LOAD DATA INFILE 'c:/x/y/z.txt' REPLACE INTO TABLE table_name FIELDS ENCLOSED BY '"' TERMINATED BY ',' (col1,path,file,other_info) ; Thanks, Dave -- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/[email protected]