使用换行符分隔符导出到文本文件 [英] Export to Text File with newline delimiter

查看:158
本文介绍了使用换行符分隔符导出到文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我需要将查询导出到文本文件,但我需要用新行分隔每个字段

。似乎找不到办法。


任何想法..


谢谢


jim

Hi All,

I need to export a query to a text file but i need each field delimited
by a new line. Cant seem to find a way to do it.

any ideas..

thanks

jim

推荐答案

Jim,


你能澄清你的意思吗?每个字段由新行。

查询是否返回多条记录?


Steve

" jim" < ji *@blahblah.blah写在消息中

新闻:4 _ ***************************** *@posted.metro net ...
Jim,

Could you clarify what you mean by "each field delimited by a new line".
Does the query return multiple records?

Steve
"jim" <ji*@blahblah.blahwrote in message
news:4_******************************@posted.metro net...

大家好,


我需要将查询导出到文本文件但我需要每个字段由

a新行分隔。似乎找不到办法。


任何想法..


谢谢


jim
Hi All,

I need to export a query to a text file but i need each field delimited by
a new line. Cant seem to find a way to do it.

any ideas..

thanks

jim



史蒂夫,


感谢您的回复...我有一个用户名和电子邮件地址的表格

我希望输出如下:


username1

email1


用户名2

email2

用户名3

email3


而不是:

username1,email1

username2,email2

username3,email3

似乎无法找到做到这一点....任何想法赞赏..


欢呼


jim

Mark写道:
Hi Steve,

Thanks for the reply... i have a table with username and email addresses
and i wish to output it as follows:

username1
email1

username2
email2

username3
email3

rather than:
username1, email1
username2, email2
username3, email3
cant seem to find a way to do it.... any ideas appreciated..

cheers

jim
Mark wrote:

Jim,


你能否澄清你所说的由新线路划分的每个字段的意思。 />
查询是否返回多条记录?


Steve


" jim" < ji *@blahblah.blah写在消息中

新闻:4 _ ***************************** *@posted.metro net ...
Jim,

Could you clarify what you mean by "each field delimited by a new line".
Does the query return multiple records?

Steve
"jim" <ji*@blahblah.blahwrote in message
news:4_******************************@posted.metro net...

>大家好,

我需要将查询导出到文本文件但是我需要每个字段由
分隔一个新行。似乎无法找到办法。

任何想法..

jim
>Hi All,

I need to export a query to a text file but i need each field delimited by
a new line. Cant seem to find a way to do it.

any ideas..

thanks

jim



嗨Jim,


请尝试以下方法:


Dim DB作为DAO.Database

Dim Rst作为记录集

设置DB = CurrentDB()

设置Rst = DB.OpenRecordset(" NameOfYourTable")

打开" C:\ TESTFILE.Txt"输出为#1

直到Rst.EOF

打印#1,Rst!用户名

打印#1,Rst!电子邮件

打印#1,"

Rst.MoveNext

循环

关闭#1

设置DB =无任何

Rst.Close

设置Rst = Nothing


注意......


1.在Open" C:\ TESTFILE.Txt"行中对于输出为#1,将

C:\ TESTFILE.Txt更改为您要存储文本数据的位置。

2.在两行中,Print#1, Rst!用户名和打印#1,Rst!电子邮件,

一定要使用表格中的实际字段名称


我为用户提供帮助资源使用Access,Excel和Word

应用程序。我的费用非常合理。如果您需要新闻组提供的帮助,请通过 rl****@penn.com与我联系。


史蒂夫


" jim" < ji *@blahblah.blah在留言中写道

新闻:fP ***************************** *@posted.metro net ...
Hi Jim,

Try the following:

Dim DB As DAO.Database
Dim Rst As Recordset
Set DB = CurrentDB()
Set Rst = DB.OpenRecordset("NameOfYourTable")
Open "C:\TESTFILE.Txt" For Output As #1
Do Until Rst.EOF
Print #1, Rst!UserName
Print #1, Rst!Email
Print #1, ""
Rst.MoveNext
Loop
Close #1
Set DB = Nothing
Rst.Close
Set Rst = Nothing

Notes ....

1. In the line Open "C:\TESTFILE.Txt" For Output As #1, Change
C:\TESTFILE.Txt to wherever you wantto store your text data.
2. In the two lines, Print #1, Rst!UserName and Print #1, Rst!Email, be
sure to use the actual field names in your table

I provide users a resource for help with Access, Excel and Word
applications. My fees ar very reasonable. If you ever need help beyond what
a newsgroup can provide, please contact me at rl****@penn.com.

Steve

"jim" <ji*@blahblah.blahwrote in message
news:fP******************************@posted.metro net...

嗨Steve,


感谢您的回复...我有一个用户名和电子邮件地址的表格

我希望输出如下:


username1

email1


用户名2

email2

用户名3

email3


而不是:

username1,email1

username2,email2

username3,email3


cant似乎找到了办法....任何想法都赞赏..


欢呼


jim


Mark写道:
Hi Steve,

Thanks for the reply... i have a table with username and email addresses
and i wish to output it as follows:

username1
email1

username2
email2

username3
email3

rather than:
username1, email1
username2, email2
username3, email3
cant seem to find a way to do it.... any ideas appreciated..

cheers

jim
Mark wrote:

> Jim,

你能澄清你的意思吗?每个字段由a划分新行。
查询是否返回多条记录?

史蒂夫

" jim" < ji*@blahblah.blahwrote in message
新闻:4 _ ****************************** @发布。 metr onet ...
>Jim,

Could you clarify what you mean by "each field delimited by a new line".
Does the query return multiple records?

Steve
"jim" <ji*@blahblah.blahwrote in message
news:4_******************************@posted.metr onet...

>>大家好,

我需要将查询导出到文本文件,但我需要每个字段由新行划界。似乎找不到办法。

任何想法..

jim
>>Hi All,

I need to export a query to a text file but i need each field delimited
by a new line. Cant seem to find a way to do it.

any ideas..

thanks

jim


这篇关于使用换行符分隔符导出到文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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