I have a small issue importing a csv file into mysql. I am using csv file with loaddata as import.
The escape char that the supplier of the csv file have chosen to use is : ¤ What ever I try to enter when importing the csv file ends up with this error:
LOAD DATA LOCAL INFILE 'C:\\xampp\\tmp\\php1E14.tmp' INTO TABLE `TableName` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\¤' LINES TERMINATED BY '
'
MySQL returned: Documentation
#1083 - Field separator argument is not what is expected; check the manual
Any ideas on how to fix this issue, and please not just have the supplier using another escape char.
Why are you prefixing your escape character with a literal backslash? Indeed, as documented under LOAD DATA INFILE
Syntax:
If not empty, the
FIELDS [OPTIONALLY] ENCLOSED BY
andFIELDS ESCAPED BY
values must be a single character.
Therefore:
LOAD DATA LOCAL INFILE 'C:\\xampp\\tmp\\php1E14.tmp'
INTO TABLE `TableName`
FIELDS
TERMINATED BY ';'
ENCLOSED BY '"'
ESCAPED BY '¤'
LINES
TERMINATED BY '
'