troubleshooting Question

Import CSV problem

Avatar of Nyackflash
NyackflashFlag for United States of America asked on
MySQL Server
5 Comments1 Solution1495 ViewsLast Modified:
I am attempting to import a text file into a 2 field table using "load data infile".

This is the file:

"05","Cape May"

Each line is terminated by a carriage return and line feed.

this is the code

INTO TABLE countiestest
      FIELDS       TERMINATED BY ','
                  ENCLOSED BY '"'
                  ESCAPED BY '\r\n'

 This code results in: Error Code: 1083. Field separator argument is not what is expected; check the manual      0.000 sec

with ESCAPED BY '\r' I get a single record back
             '01', 'Atlantic\"\n\"02'
with ESCAPED BY '\n' I get a single record back
             '01', 'Atlantic\"\r\"02'

with ESCAPED BY '\\' I get
'1', '0', 'Berg', 'Burlington\"\r\n\"04'
'5', '0', 'Cumb', 'Essex\"\r\n\"08'
'9', '0', 'Hunt', 'Mercer\"\r\n\"12'
'13', '0', 'Morr', 'Ocean\"\r\n\"16'
'17', '0', 'Some', 'Sussex\"\r\n\"20'
'21', '0', '', ''

Dose anybody have a clue what is going on here?

Bill Cook
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros