CSV导出:强制尾随逗号? [英] CSV Export: Force Trailing Comma?

查看:61
本文介绍了CSV导出:强制尾随逗号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,


我正在使用DoCmd.TransferText方法将MS

Access查询的结果导出到csv文件。 csv将用于加载Oracle

表。


在其他系统(如TOAD for Oracle)中,可以强制

在最后一列之后的额外逗号分隔符,如果列是空的

在特定行上。为了导入目的,Oracle在空的

最右边的列上需要这个额外的逗号。


我无法在Visual Basic TransferText中看到如何执行此操作$>
方法,或者在MS Access导出规范中。


这可以在VB / Access中完成,以及如何实现?

解决方案

在您的查询中,使用如下所示的计算字段:

RevisedLastField:[LastFieldname]& ","


取消选中LastFieldName列中的''Show''框,并确保选中''Show''

框RevisedLastField列。你想出口

RevisedLastField而不是LastFieldName。


-

PC数据表

你的访问,Excel和Word应用程序的资源帮助

超过1150位用户来自新闻组请求帮助
re ****** @ pcdatasheet.com

" bonehead" < SE ********** @ here.net>在消息中写道

news:e0 ********** @ gondor.sdsu.edu ...

问候,
我正在使用DoCmd.TransferText方法将MS
Access查询的结果导出到csv文件。然后csv将用于加载Oracle
表。

在其他系统(如TOAD for Oracle)中,可以强制使用
后续的逗号分隔符。最后一列,如果某列上的列是空的
。为了导入目的,Oracle在空的最右边的列上需要这个额外的逗号。

我无法在Visual Basic TransferText方法,或者在MS中看到如何执行此操作。访问导出规范。

这可以在VB / Access中完成吗?



bonehead< se *** *******@here.net>写在

新闻:e0 ********** @ gondor.sdsu.edu:

问候,

在其他系统(如TOAD for Oracle)中,可以在之后强制使用额外的逗号分隔符。最后一列,如果该列在特定行上为空。为了导入
目的,Oracle在最右边的列上需要这个额外的逗号。

我无法在Visual Basic
TransferText方法中看到如何执行此操作,或者在MS Access导出
规范中。

这可以在VB / Access中完成,以及如何完成?



Access始终输入正确的数字逗号。如果你需要在每一行的末尾添加一个额外的逗号,请在查询中为计算的最右边字段添加null作为

表达式。

-

Bob Quintal


PA是我改变了我的电子邮件地址。


< blockquote>

" PCD" <无*** @ email.com> schreef在bericht新闻:sg ****************** @ newsread1.news.atl.earth link.net ...


-

PC数据表
您的资源以获取Access,Excel和Word应用程序的资源????
超过1150位用户来自新闻组请求帮助''1150位用户????
重新* *****@pcdatasheet.com




-

给史蒂夫:

超过575 !!来自新闻组的用户已经访问过该网站以阅读您所使用的资源...(迅速增加......)


到原始海报:


这里的大多数人都有一个共同的信念,即新闻组是*免费的信息交换*。

但史蒂夫是这些团体中臭名昭着的求职者,总是试图出售他的服务。


在你打算与他做生意之前看看:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R

Greetings,

I''m using the DoCmd.TransferText method to export the results of a MS
Access query to a csv file. The csv will then be used to load an Oracle
table.

In other systems such as TOAD for Oracle, it''s possible to force an
additional comma delimiter after the last column, if the column is empty
on a particular row. Oracle requires this additional comma on empty
rightmost columns, for importing purposes.

I am unable to see how to do this in the Visual Basic TransferText
method, or in the MS Access export specifications.

Can this be done in VB/Access, and how?

解决方案

In your query, use a calculated field that looks like this:
RevisedLastField:[LastFieldname] & ","

Uncheck the ''Show'' box in the LastFieldName column and be sure the ''Show''
box is checked in the RevisedLastField column. You want to export
RevisedLastField rather than LastFieldName.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com
"bonehead" <se**********@here.net> wrote in message
news:e0**********@gondor.sdsu.edu...

Greetings,

I''m using the DoCmd.TransferText method to export the results of a MS
Access query to a csv file. The csv will then be used to load an Oracle
table.

In other systems such as TOAD for Oracle, it''s possible to force an
additional comma delimiter after the last column, if the column is empty
on a particular row. Oracle requires this additional comma on empty
rightmost columns, for importing purposes.

I am unable to see how to do this in the Visual Basic TransferText method,
or in the MS Access export specifications.

Can this be done in VB/Access, and how?



bonehead <se**********@here.net> wrote in
news:e0**********@gondor.sdsu.edu:

Greetings,

I''m using the DoCmd.TransferText method to export the results
of a MS Access query to a csv file. The csv will then be used
to load an Oracle table.

In other systems such as TOAD for Oracle, it''s possible to
force an additional comma delimiter after the last column, if
the column is empty on a particular row. Oracle requires this
additional comma on empty rightmost columns, for importing
purposes.

I am unable to see how to do this in the Visual Basic
TransferText method, or in the MS Access export
specifications.

Can this be done in VB/Access, and how?


Access always puts the correct number of commas. If you need an
additional comma at the end of every row, add null as the
expression for the calculated rightmost field in the query.
--
Bob Quintal

PA is y I''ve altered my email address.



"PCD" <no***@email.com> schreef in bericht news:sg******************@newsread1.news.atl.earth link.net...

--

PC Datasheet
Your Resource For Help With Access, Excel And Word Applications ''Resource ????
Over 1150 users have come to me from the newsgroups requesting help ''1150 users ????
re******@pcdatasheet.com



--
To Steve:
Over 575!! users from the newsgroups have visited the website to read what kind of a ''resource'' you are... (rapidly increasing..)

To the original poster:

Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R


这篇关于CSV导出:强制尾随逗号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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