This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 问大侠:在vi编辑器中,怎样用一条命令删除文件中所有含字符串“abcdefg"的行?
-eagle_no1(瞎起哄);
2006-6-6
(#3013735@0)
-
?
-eagle_no1(瞎起哄);
2006-6-6
(#3013765@0)
-
try 0,$s/abcdefg//g
-f001(高望川);
2006-6-6
(#3013767@0)
-
thx,但有空行。
-eagle_no1(瞎起哄);
2006-6-6
(#3013775@0)
-
vi不会,但会用sed-->sed -e '/.*abcdef/d' < infile > outfile
-canadiantire(轮胎-cui bono?);
2006-6-6
(#3013790@0)
-
那原来的空行又没了。 :-((
-eagle_no1(瞎起哄);
2006-6-6
(#3013799@0)
-
不会吧。
-647i(流浪的步行万里);
2006-6-6
(#3013804@0)
-
It works well.
-hahahaly(hahahaly);
2006-6-6
(#3013848@0)
-
应该用这个方法
-eagle_no1(瞎起哄);
2006-6-6
(#3013842@0)
-
this is good too.
-iwantcar(流浪的EnjoyStudying);
2006-6-6
(#3014048@0)
-
我一般用C,习惯了很快
-iwantcar(流浪的EnjoyStudying);
2006-6-6
(#3013806@0)
-
grep -v 'abcdefg' fileA > fileB; mv fileB fileA
-j30(猪狗不如);
2006-6-6
(#3013811@0)
-
sound good.
-iwantcar(流浪的EnjoyStudying);
2006-6-6
(#3013818@0)
-
你真能够记的.我现在用C习惯了,什么一想,写个C也就15分钟的事情.就什么命令格式都不记了.
-iwantcar(流浪的EnjoyStudying);
2006-6-6
(#3013823@0)
-
你用C15分钟,人grep 15秒都不到。
-holdon(again);
2006-6-6
(#3013888@0)
-
问这个问题的时间就不止15分钟了,何况,大部分的问题哪有这么简单的,我也不反对使用命令,只是对于我来说,写C就和写SCRIPT没有什么区别.其实,SCRIPT我也写的.当我也使用命令的时候.
-iwantcar(流浪的EnjoyStudying);
2006-6-6
(#3013955@0)
-
老大,是在vi里面好不好
-pasu(InTheSky);
2006-6-6
(#3013833@0)
-
or this one
-eagle_no1(瞎起哄);
2006-6-6
(#3013844@0)
-
哥们: 我让一老兄手工给我一行行的全删了; 哈哈!
-eagle_no1(瞎起哄);
2006-6-6
(#3013816@0)
-
hahaha
-canadiantire(轮胎-cui bono?);
2006-6-6
(#3013822@0)
-
cat text |grep -v abcdefg
-oasis(oasis);
2006-6-6
(#3013819@0)
-
#3013844@0
-eagle_no1(瞎起哄);
2006-6-6
(#3013845@0)
-
you can use :g/abcdefg/d inside vi
-oasis(oasis);
2006-6-6
(#3013846@0)
-
It works well.
-hahahaly(hahahaly);
2006-6-6
(#3013869@0)
-
Thank you sir!! this is right what i want. :g/marchstring/d or :startline,endlineg/marchstring/d
-eagle_no1(瞎起哄);
2006-6-6
(#3013886@0)
-
It seems that everyone here is smarter than you and your "老兄".
-hahahaly(hahahaly);
2006-6-6
(#3013874@0)
-
这个比我笨 #3013806@0
-eagle_no1(瞎起哄);
2006-6-6
(#3013912@0)
-
我也会用VI.只是不愿意费那脑子.其实,我还在vi里写过小SCRIPT呢.
-iwantcar(流浪的EnjoyStudying);
2006-6-6
(#3013963@0)
-
跟你开玩笑呢。 别在意 :-))
-eagle_no1(瞎起哄);
2006-6-6
(#3013972@0)
-
象这些话,我压根就不会放在心上.我有自知之明,这些SCRIPT,我是很差的,都是要用的时候才急急忙忙地去读MANUAL.
-iwantcar(流浪的EnjoyStudying);
2006-6-6
(#3013983@0)
-
大伙用的这些工具都很熟,而我,可能是因为写程序多了,什么都想自己干.其实也不难,曾经写过EMAIL分析程序,人写的EMAIL,程序分析,其实也就是一些规则而已,字符从一边流入,根据状态和规则进行分析,也写过语法严密的分析执行程序,也是差不多,至于大规模的数据文件处理,也是很容易的.习惯了就好.而用命令,有时候就不那么简单了.
-iwantcar(流浪的EnjoyStudying);
2006-6-6
{223}
(#3013996@0)
-
你也太幽默了点吧, 偷偷塞个贴子在这里,以为我发现不了?#3012795@0
-eagle_no1(瞎起哄);
2006-6-6
(#3014071@0)
-
gawk '$0 !~ /abcdefg/ { print $0} '
-holdon(again);
2006-6-6
(#3013875@0)
-
by only use VI.0.
grep abcdef <the file> |wc
to get howmany lines with "abcdef". Support it is 789
A. in command mode, type "/abcdef" and return. it will search on "abcdefg".
B. open another shell and start vi,
type in following
d
n
then duplicate it 789 times by
2dd789P
C. copy the text in the new file
D. pasete to the file need to proced.
DONE
-647i(流浪的步行万里);
2006-6-6
{371}
(#3013992@0)