首先,我在韩国。所以我的英语会很糟糕。如何在不编辑其他行的情况下编辑文本文件(cmd)
我想编辑第三行,不用触摸第一行和第二行。
前:
echo sample
echo sample
echo sample
echo sample
后:
echo sample
echo sample
echo hello
echo sample
就这样。 不使用这个命令:
echo echo sample> test.txt
echo echo sample> test.txt
echo echo hello> test.txt
echo echo sample> test.txt
所以,我的意思是不是写1,2,4的“回声”和“样本”的事情。 只有第三行的'回声'。 我能做什么?
我建议你[安装cygwin](http://cygwin.com),然后你可以使用像sed和awk这样的标准* nix工具,这样的任务很简单。 –
无法在'cmd'中“编辑”文件。您必须逐行阅读并重写整个文件(使用[for](https://ss64.com/nt/for_f.html))。 – Stephan