让VBA从下到上追加txt
我想向后附加一个文本 (.txt) 文件,这可能吗?
我所说的向后是指从下到上书写文本,而不是从上到下标准书写。
为什么是因为我要编译的txt文件被读取,以便列表顶部的项目优先于底部的项目。
I would like to append a text (.txt) file backwards is this possible?
By backwards I mean writing text from bottom to top rather then the standards top to bottom.
Why because the txt file I want to compile is read so that items at the top of the list are given priority to those at the bottom.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
每当您想在顶部插入数据,然后删除/重命名旧文件并将新文件重命名为新文件时,除了创建一个新文件之外,我想不出任何其他方法。
I can't think of any other way than to create a new file whenver you want to insert data at the top and then delete/rename the old one and rename the new file to the new one.
不确定您的具体要求,但 VBA 中最简单的方法是
1. 添加对 Microsoft Scripting Runtime 的引用。
这是一个基本的表格,应该可以帮助您前进。
Not sure exactly your requirements BUT the easiest way in VBA is to
1. Add a reference to the Microsoft Scripting Runtime.
This is a basic form which should get you going.
数组怎么样?它不适合非常大的文件:
How about an array? It would not be suitable with a very large file:
如果只是按照与显示顺序相反的顺序编写每个段落或句子:
If it's just writing each paragraph or sentence in the reverse order than it appears: