erlug
[Top] [All Lists]

Re: [Erlug] trovare righe con numero caratteri <n

To: erlug@xxxxxxxxxxxxxx
Subject: Re: [Erlug] trovare righe con numero caratteri <n
From: Maurizio Lemmo - Tannoiser <tann@xxxxxxxxx>
Date: Wed, 6 Nov 2002 16:10:19 +0100
* mercoledì 06 novembre 2002, alle 15:03, Alessandro Ronchi scrive:
> Avrei bisogno di filtrare un insieme di righe (provenienti in  pipe da un 
> altro programma), lasciando solamente quelle che hanno meno di n caratteri.
> Si può?

non e` detto che non si faccia in altro modo, cmq, questo dovrebbe
funzionare:

cat yourfile.txt | perl -ane 'chomp; $buf=$_; if (length $buf < __num__)
{ print $buf,"\n"; $buf="" }'

tutto su una riga. sostituisci __num__ con il numero che ti pare.

-- 
                          Maurizio - Tannoiser - Lemmo
                 Founder Member of ERLUG http://erlug.linux.it
-------------------------------------------------------------------------------
Xander: "Ice water. Do you want that on the rocks?"
        --Buffy the Vampire Slayer: Beer Bad

<Prev in Thread] Current Thread [Next in Thread>