使用换行符分隔符导出到文本文件

编程入门 行业动态 更新时间:2024-10-11 17:20:04
本文介绍了使用换行符分隔符导出到文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我需要将查询导出到文本文件,但我需要用新行分隔每个字段 。似乎找不到办法。 任何想法.. 谢谢 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 bya new line. Cant seem to find a way to do it.any ideas..thanksjim

嗨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与我联系。 。 史蒂夫 " 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. 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 messagenews:4_******************************@posted.metr onet... >>大家好, 我需要将查询导出到文本文件,但我需要每个字段由新行划界。似乎找不到办法。 任何想法.. jim >>Hi All,I need to export a query to a text file but i need each field delimitedby a new line. Cant seem to find a way to do it.any ideas..thanksjim

更多推荐

使用换行符分隔符导出到文本文件

本文发布于:2023-11-24 05:58:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624170.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本文件   分隔符   导出到   换行符

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!