dracularking 发表于 2013-1-15 08:12:34

文件内容操作batch

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.txtdel search.txtren 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
 
页: [1]
查看完整版本: 文件内容操作batch