我有一個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