Access解析CSV文件中双引号的问题 [英] Issues with Access parsing double quotes in a CSV file

查看:54
本文介绍了Access解析CSV文件中双引号的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的CSV文件,我试图将其导入Microsoft Access,但是遇到了问题.假设管道代表数据库中的不同单元格

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

假设我的内容如下.第二个条目将仅使用默认设置来解析单词my,即使导入向导暗示可以,也不会将单词内容导入数据库.默认设置为,分隔符和文本限定符".

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|

现在,如果我将文本修饰符更改为NONE,它将解析整个第二个条目,并且我的内容将被导入数据库,但是第一个条目将出现在数据库的3个不同单元格中,并显示为

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.

这似乎是Microsoft Access中的限制.有谁熟悉解决方法吗?

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

原始内容:

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

,my"content","",

我正在使用导入向导

推荐答案

是的,这是Access中CSV导入功能的限制.无论出于何种原因,Access解析CSV文件的能力始终比Excel更为严格.

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.

因此,一种解决方法是在Excel中打开CSV文件,将文件另存为实际的Excel工作表,然后将Excel工作表导入Access.例如,CSV文件

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."

是非标准的"(如果愿意承认存在诸如CSV标准"之类的东西),Access不能直接将其导入.(它会抱怨无法解析的记录",或者会根据文本限定符"设置拆分逗号的最后一个字段.)

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.)

但是,我们可以在Excel中打开它

However, we can open it in Excel

将文件另存为"foo.xlsx",然后将.xlsx文件导入Access

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

这篇关于Access解析CSV文件中双引号的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆