跳过前三行的CSV文件(使用的DoCmd?)在MS Access [英] Skip first three lines of CSV file (using DoCmd?) in MS Access

查看:422
本文介绍了跳过前三行的CSV文件(使用的DoCmd?)在MS Access的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要跳过一个CSV文件的前三行加载到MS Access时。默认的CSV导入不降的前三行。我想到的是写一个宏忽略前三行的。

I need to skip the first three lines of a CSV file when loading into MS Access. The default CSV import does not drop the first three lines. I am thinking of writing a macro to ignore the first three lines.

我的研究表明DoCmd对象,但其方法并不满足跌落第一个X行。

My research has shown the DoCmd object but its methods do not cater to drop the first x lines.

有什么想法?

推荐答案

的的 DoCmd.TransferText 方法需要SpecificationName作为它的一个参数。请在如何创建一个导入规格的创建和保存导入规格。

The DoCmd.TransferText method takes a SpecificationName as one of its arguments. Follow the instructions at How to Create an Import Specification to create and save an import specification.

现在进入访问选项,导航选项,显示隐藏/系统对象。您现在应该能够打开一个名为mSysIMEXSpecs表。找到前面创建的基础上SpecName列进口规范。在STARTROW栏中,输入规格更改为3(STARTROW是从零开始的)。

Now go into Access Options, Navigation Options, and show hidden/system objects. You should now be able to open a table named 'mSysIMEXSpecs'. Find the import spec you created earlier based on the SpecName column. Change the 'StartRow' column for that import spec to 3 (the StartRow is zero-based).

现在你应该可以使用DoCmd.TransferText方法传递您所创建的导入规范的名称,它会跳过你的前三行。

Now you should be able to use the DoCmd.TransferText method passing the name of the import spec you created and it will skip your first three lines.

这篇关于跳过前三行的CSV文件(使用的DoCmd?)在MS Access的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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