文件内容操作batch
程序员文章站
2022-05-08 19:21:18
...
I've learnt it from csdn qybao(阿宝), thanks for him^^
for example, we need replace or delete some string in the text file, in common way, i'd like to use java to fulfil it, but here use batch...
findstr /V ABCDEFG search.txt > xx.txt
del search.txt
ren xx.txt search.txt
with this batch, it deletes the line which contains the string "ABCDEFG" and generates the new file xx.txt
here's the explanation of the dos command findstr and its parameter /V
http://www.computerhope.com/findstr.htm
上一篇: UDP连接