[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Grep
From: |
jaugusto |
Subject: |
Re: [shell-script] Grep |
Date: |
Wed, 10 Oct 2001 16:35:47 -0300 |
Laudelino
O comando abaixo resolve o seu problema, retirando do arquivo todas as
linhas que possuem nenhum, 1, 2, 3, ou 4 caracteres.
grep -v '^.\{1,4\}$' arquivo_original > arquivo_final
entre aspas existe na sequencia.
^ - Acento circunflexo
. - ponto
\ - barra invertida
{ - chave
1,4 de 1 a 4 caracteres
\ - outra barra invertida
} - outra chave
$ - Cifrao
[ ]'s a todos da lista
José Augusto Martins Nieviadonski
HSBC Bank Brasil S.A.
Treinamento de Informática
Analista de Suporte Consultor / Instrutor
Enviado Por : "Laudelino Lima" <address@hidden> - 10/10/01 09:50
Responder a shell-script
Para: <address@hidden>
cc: (cco: Jose NIEVIADONSKI/HBBR/HSBC)
Assunto: [shell-script] Grep
Tenho uma lista com 60.000 sites inúteis que vou usar no meu squid.
1 por linha.
Só Que.
tem alguns sites com nomes muito curtos tipo 4 caracteres que se confundem
com sites válidos
Tipo
0069
sex0
sex01
só que tem sites em que a url aparece essas letras
www.odia.com.br/materias/maio/diasemana-sex01/topicos.htm
www.odia.com.br/materias/maio/diasemana-sex02/topicos.htm
quero tirar do arquivo todas as linhas que tenham menos que 5 caracteres !
[As partes desta mensagem que não continham texto foram removidas]
Sair da lista: address@hidden
Banco Dados: http://www.egroups.com/group/shell-script
Seu uso do Yahoo! Grupos é sujeito às regras descritas em:
http://br.yahoo.com/info/utos.html
This message and any attachments are confidential to the ordinary user of
the e-mail address to which it was addressed and may also be privileged. If
you are not the adressee you may not copy, forward, disclose or use any
part of the message or its attachments and if you have received this
message in error, please notify the sender immediately by return e-mail and
delete it from your system.
Internet communications cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, arrive late or contain
viruses. The sender therefore does not accept liability for any errors or
omissions in the context of this message which arise as a result of
Internet transmission.
From (no email address) Wed Oct 10 13:07:53 2001
Return-Path: <address@hidden>
X-Sender: address@hidden
X-Apparently-To: address@hidden
Received: (EGP: mail-7_4_1); 10 Oct 2001 20:04:54 -0000
Received: (qmail 59157 invoked from network); 10 Oct 2001 20:04:53 -0000
Received: from unknown (10.1.10.27)
by 10.1.1.221 with QMQP; 10 Oct 2001 20:04:53 -0000
Received: from unknown (HELO perninha.conectiva.com.br) (200.250.58.156)
by mta2 with SMTP; 10 Oct 2001 20:07:49 -0000
Received: from burns.conectiva (burns.conectiva [10.0.0.4])
by perninha.conectiva.com.br (Postfix) with SMTP id 1B1183B6B8
for <address@hidden>; Wed, 10 Oct 2001 17:07:23 -0300 (EST)
Received: (qmail 5810 invoked by uid 0); 10 Oct 2001 20:05:21 -0000
Received: from verde.distro.conectiva (10.0.17.77)
by burns.conectiva with SMTP; 10 Oct 2001 20:05:21 -0000
Date: Wed, 10 Oct 2001 17:08:28 -0300 (BRT)
X-X-Sender: <verde@verde.distro.conectiva>
To: <address@hidden>
Subject: Re: [shell-script] Grep
In-Reply-To: <address@hidden>
Message-ID: <Pine.LNX.4.33L.0110101706170.941-100000@verde.distro.conectiva>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=iso-8859-1
Content-Transfer-Encoding: 8BIT
X-eGroups-From: # aurelio marinho jargas <address@hidden>
From: # aurelio marinho jargas <address@hidden>
ae josé,
@ 10/10, address@hidden:
> O comando abaixo resolve o seu problema, retirando do arquivo todas as
> linhas que possuem nenhum, 1, 2, 3, ou 4 caracteres.
opa, "nenhum" só se trocar o 1 por 0 no {1,4}!
mas eu ainda acho alógica inversa mais fácil:
grep '.....' arquivo
> grep -v '^.\{1,4\}$' arquivo_original > arquivo_final
>
> entre aspas existe na sequencia.
> ^ - Acento circunflexo
> . - ponto
> \ - barra invertida
> { - chave
> 1,4 de 1 a 4 caracteres
> \ - outra barra invertida
> } - outra chave
> $ - Cifrao
> quero tirar do arquivo todas as linhas que tenham menos que 5 caracteres !
--
s·:(·>(·×^a]×http://www.verde666.org×^[:wq