模拟 .txt 中的 ENTER

发布于 2024-08-28 23:20:45 字数 246 浏览 4 评论 0原文

有人可以帮忙在 .txt 文件中添加 enter 命令来模拟 enter 吗?

示例:
12345输入548793输入.....

其中条目将是一个数字,然后输入到下一个字段,其中下一个数字将被插入等等......所以它看起来像这样:

12345
548793
etc...

Can someone please help in adding a command for enter in a .txt file to emulate enter.

Example:
12345enter548793enter.....

where an entry will be a number followed by enter to next field where the next number will be inserted etc.. so it will look like this:

12345
548793
etc...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

骷髅 2024-09-04 23:20:45

输入和返回之间有区别(--old skool 打字机的东西--查看维基百科)。

一种是回车,一种是换行;它们的 ASCII 代码是 10 和 13,我会说测试并找出您需要哪一个(如果不是两者)。

通常(在 C++、C# 等中)你会发布 \r\n --> 10 13

There is a difference between an enter and a return (-- old skool typewriter stuff - check Wikipedia on that).

One is a carriage return and one is a line feed; the ASCII codes for those are 10 and 13, I'd say test and find out which one (if not both) you'll need.

Normally (in like C++,C#,etc) you'd post \r\n --> 10 13

关于从前 2024-09-04 23:20:45

只需在文件中添加换行符?

12345
548793
etc...

Just add newlines in the file?

12345
548793
etc...
情徒 2024-09-04 23:20:45

在 txt 文件中读取的脚本应该已经识别文本编辑器使用的 EOL 字符。许多脚本语言在读取文件句柄时会自动理解各种 EOL。如果您的没有,您可能必须编写一个正则表达式来查找最常见的正则表达式。

The script that is reading in your txt file should already recognize whichever EOL character the text editor used. Many scripting languages automatically understand the various EOLs when reading from a filehandle. If yours doesn't, you may have to compose a regex that looks for the most common ones.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文