I have a CSV file that I'm trying to import into MySQL but one of the columns is being split into several columns.
Here is a sample of the CSV:
Code,SpecificIssue,Issues_Id
"MEDICARE/MEDICAID","State Medicaid waivers",0
"EDUCATION","Distance Education, Accreditation, and Issues Affecting Access to Title IV Loans in Higher education Act reauthorization; issues affecting veterans access to education benefits.",1
"LAW ENFORCEMENT/CRIME/CRIMINAL JUSTICE","Issues related to law enforcement funding; S. 3182.",2
"TRANSPORTATION","Issues related to transportation improvements funding. S. 3261.",2
"HEALTH ISSUES","Issues related to funding for health care outreach, S. 3230.",2
The first record is being split between "Distance Education" and "Accreditation", and the last record is being split between "outreach" and "S.".
I'm using the instructions provided at http://dev.mysql.com/doc/refman/5.1/en/load-data.html as a reference. The SQL import query is like so:
load data local infile '/path/to/csv/example.csv'
into table lobby
fields terminated by ','
enclosed by '"'
lines terminated by '\n';
It seems to me that the enclosed by quotes instruction is being ignored, but I have no idea why or how to get around it.