从命令提示符 Windows 7 将文本插入到文件中

发布于 2024-12-11 06:58:28 字数 95 浏览 3 评论 0原文

我想在 Windows 7 中从命令提示符编辑一个文本文件。我有一个文本文件,我想在该文件中搜索特定的字符串。然后我需要在字符串中附加一些字符串。 然后,我需要保存或覆盖它。

I want to edit a text file from command prompt in Windows 7. I have a text file, i want to search for particular String in that file. then I need to append some more string to string.
Then, I need to save or over write it.

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

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

发布评论

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

评论(1

乖乖公主 2024-12-18 06:58:28

批处理命令语言不太适合此类任务。使用其他脚本语言会更好,例如 js 或 vbs 或(如果您的目标是 Windows 7)powershell。如果您确实想使用批处理命令语言来执行此操作,您可以使用 for /f 拼凑一些东西来从输入文件中读取内容,并使用 echo 写入到输出文件。请注意,这不会很有趣。

The batch command language is not well-suited to this sort of task. You would be much better served using some other scripting language, like js or vbs or (if you are targeting Windows 7) powershell. If you really want to do it in the batch command language, you can sort of cobble something together with for /f to read from the input file and echo to write to the output file. Mind you, it won't be fun.

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