Issues with Access parsing double quotes in a CSV file

一世执手 提交于 2021-02-10 18:34:43

问题


I have a large CSV file that I am trying to import into Microsoft Access but I am running into issues. Assume pipes represent different cells in the database

Assume my content is the below. The second entry will only parse the word my with default settings and will not import the word content into the database even though the import wizard implies that it will. The default settings being , delimiter and " text qualifier.

|my content is good|
|my|

Now if i change the text qualifier to NONE it parses the entire second entry and my content will be imported into the database however the first entry will wind up being in 3 different cells in the data base and will show up as

my|content|is|good. 
|my content

I used pipes to imply different cells.

This seems like a limitation in Microsoft Access. Is anyone familiar with a workaround for this?

Original content:

,"my,content,is,good","",

,my"content","",

I am using the import wizard


回答1:


Yes, this is a limitation of the CSV import capabilities in Access. For whatever reason, Access has always been more restrictive than Excel in its abilities to parse CSV files.

So, one workaround would be to open the CSV file in Excel, save the file as an actual Excel sheet, and then import the Excel sheet into Access. For example, the CSV file

this,is,a "test",CSV file,"Ugly, yes, but still parsable."

is "non-standard" (if one is willing to concede that there is such a thing as a CSV "standard"), and Access cannot import it directly. (It either complains of an "Unparsable Record" or it splits the last field on the commas, depending on the "Text Qualifier" setting.)

However, we can open it in Excel

Excel.png

save the file as "foo.xlsx", and then import the .xlsx file into Access

Access.png



来源:https://stackoverflow.com/questions/22502719/issues-with-access-parsing-double-quotes-in-a-csv-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!