Opa cara, Obrigado pelo feedback. Não devo ter me expressado bem. Mais queria remover as ocorrências. Tipo, na linha que contem o acesso em 2008, eu apagar tudo que tiver em 2008, as linhas.
2009/6/3 Flavio Torres <fla_tor...@yahoo.com.br> > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Anderson Nascimento wrote: > > Lista, > > > > Estou batendo a cabeça para remover determinadas linhas de um arquivo. > > > > Seguinte. > > > > tenho um arquivo que tem o seguinte conteudo. > > > > Sun Nov 23 06:32:10 2008 1055 xxx.xxx.xxx.xxx. TCP_MISS/200 198395 GET > > http://www.uol.com.br - DIRECT/200.221.2.45 text/html > > Sun Nov 23 06:37:10 2008 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 GET > > http://www.uol.com.br - DIRECT/200.98.249.120 text/html > > > > > > Então queria pegar apagar todas as ocorrencias de 2008 por exemplo desse > > arquivo. > > > > > > Li o man de sed mais não rolou nada. > > hmmm....Leu mesmo? > > debian:~# cat arq.txt > Sun Nov 23 06:32:10 2008 1055 xxx.xxx.xxx.xxx. TCP_MISS/200 198395 > GET http://www.uol.com.br - DIRECT/200.221.2.45 text/html > Sun Nov 23 06:37:10 2019 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 > GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html > Sun Nov 23 06:37:10 2008 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 > GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html > Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 > GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html > Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 > GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html > > debian:~# sed '/2008/d' arq.txt > Sun Nov 23 06:37:10 2019 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 > GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html > Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 > GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html > Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 > GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html > > ...skipping... > d Delete pattern space. Start next cycle. > > []'s > > - -- > > /*---------------------------------------------------*/ > /* * Flavio Torres - Administrador de Sistemas*/ > /* /_\ */int y,z;main(x){x=(x>0?-9:x);z=((z=(x+5) > /* o. .o */)>0?z:-z);printf(!x&&++y?"\n":z?z>y%3+y/ > /* ((Y)) */3?" ":x<-5?"/":"\\":y?"|":"*");y-9?main( > /* ()) (() */++x):puts(" _|_|_")&&puts(" \\___/");} > /* ()^() A party animal isn't just for Christmas.*/ > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.8 (MingW32) > > iEYEARECAAYFAkonMNkACgkQNRQApncg29712ACg7fIzszFqDm9+ikuFfgSvb/5O > x6oAoN8+QuoKnkC4vqGluE+EFp3+7tht > =ytaB > -----END PGP SIGNATURE----- > > > -- Anderson Raimundo Analista de Suporte +55 (71) 8178-5378 [As partes desta mensagem que não continham texto foram removidas]