Article View: es.comp.os.linux.programacion
Article #15818Re: Tratar texto
From: David Martínez
Date: Thu, 01 Jun 2000 00:00
Date: Thu, 01 Jun 2000 00:00
26 lines
1118 bytes
1118 bytes
Hola Esteban!
Esteban wrote:
> Tengo un fichero con un mont�n de direcciones del tipo
>
> 1001:From: "Pepe" <pepe@prueba.com>
>
> y quiero extraer �nica y exclusivamente la direcci�n que hay entre < >
> se que se puede hacer con awk o con sed, pero lo que no se es �c�mo?
y en perl? A mi me resulta m�s c�modo para estas cosas.
#!/usr/bin/perl -w
while (<>) {
($nombre)=/.*<(.*)>/;
print $nombre,"\n";
}
Usar:
./script.pl fichero_direcciones.txt > email.txt
Seguro que se puede hacer mejor ;)
Saludos
Technical Details
Message-ID:
<393670DE.857116FC@NOSPAM.inicia.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<slrn8jbum3.2ab.scandisk@localhost.localdomain>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,fdf77aa520ab4e55 X-Google-Attributes: gidf86c8,public From: David Martínez <dmartin@NOSPAM.inicia.es> Subject: Re: Tratar texto Date: 2000/06/01 Message-ID: <393670DE.857116FC@NOSPAM.inicia.es> X-Deja-AN: 629896683 Content-Transfer-Encoding: 8bit References: <slrn8jbum3.2ab.scandisk@localhost.localdomain> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: PROEL PSIC Mime-Version: 1.0 Newsgroups: es.comp.os.linux.programacion