Board logo

标题: 怎样实现编辑文本文件 [打印本页]

作者: psq     时间: 2007-2-16 09:30    标题: 怎样实现编辑文本文件

删除一文本文件中含china的行,我只知道这样做,还有其它方法吗?
copy a.txt b.txt
type b.txt | find /i /v "china" > a.txt

添加china到c.txt的文件尾部怎么实现?
作者: redtek     时间: 2007-2-16 09:40
添加 china 字符串到文件 c.txt 的尾部:)
echo china>>c.txt

作者: psq     时间: 2007-2-16 09:55
添加解决了!谢谢了!再麻烦一下:

删除一文本文件中含china的行,我只知道这样做,还有其它方法吗?
copy a.txt b.txt
type b.txt | find /i /v "china" > a.txt
作者: gne3     时间: 2007-2-17 01:11    标题: re:wo

顶下了
code:>>是追加的重定向
@echo
[ Last edited by gne3 on 2007-2-16 at 12:13 PM ]
作者: qingfushuan     时间: 2007-2-17 01:14    标题: findstr

将find换成findstr试试
findstr /v "china" 6.txt >>5.txt

将6.txt中除去有china的所有行都重定向到5.txt

[ Last edited by qingfushuan on 2007-2-16 at 12:18 PM ]