我有一个CSV文件,我试图导入到MySQL中,但其中一列正在被分成几列。将CSV导入到MySQL中很困难
这里是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
第一记录被“远程教育”和“认可”,和最后的记录之间的分裂被“展”和“S之间分割”。
我使用http://dev.mysql.com/doc/refman/5.1/en/load-data.html提供的说明作为参考。在SQL导入查询是像这样:
load data local infile '/path/to/csv/example.csv'
into table lobby
fields terminated by ','
enclosed by '"'
lines terminated by '\n';
在我看来,该用引号括指令被忽略,但我不知道为什么或如何解决它。
我尝试:INFILE‘/issue_d.csv’数据装载到由终止表问题领域‘’任选被封闭的”'被终止行'\ r \ n '忽略1行;并得到了同样的结果。 :/我很困惑。 – Twitch