且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Windows批处理脚本从文本文件中删除内容

更新时间:2023-12-05 21:01:40

break>demo.txt

尝试一下.它将在demo.txt的位置设置一个空文件.由于break是不执行任何操作的内部命令,因此它应该非常快.break命令只能使用/?参数生成输出,因此使此方法非常可靠.

Try this.it will set an empty file on the place of demo.txt. As break is internal command that does nothing it should be pretty fast.Also the break command can produce output only with /? argument so this makes this method pretty robust.