sql - MySQL loading a tab-delimited file into a table with special characters -
I want to be able to load a file into a MySQL table that has backslash in this way: < Former> User John I can not copy and paste just to fix this because there are millions of rows in this way, like havoc with backslash at different places. What is the correct way to load tabs with a backslash in a MySQL table in the Delihail file? Should I add each (column) field to the quote? Should I write a parser that removes special characters? You must specify Fred Los Angeles I Fred Nick Madison Great Lakes Wow John San Diego Hello World! \ Bob NYC Big Apple
\ at the end of column 3. When I load it in a table, MySQL interprets the backslash as a line continuation and is associated with line 3, Colonel 3 (Line 4, Call 1).
escaped BY
option when your file loads in the following example I'm assuming that your fields are divided by tabs (which is the default behavior) and the file is located on client host:
load data local INFILE '/ path / to / file / Avoid '\ t' defined in 'My.txt' table T field; 'B';
Comments
Post a Comment