[Top] [All Lists]

Re: [Erlug] Compiti di fine anno

To: ERlug - Lista Pubblica <erlug@xxxxxxxxxxxxxx>
Subject: Re: [Erlug] Compiti di fine anno
From: Marco Mariani <marco.mariani@xxxxxxxxxxxx>
Date: Wed, 30 Dec 2009 15:57:49 +0100
On 12/30/2009 02:56 PM, Michele Mordenti wrote:

> Un esercizio facile facile:
> avete un file di testo di 70000 righe circa.
> Ogni riga presenta alla colonna 72 una lettera, o "M" o "F".
> Quale comando impartire al terminale per:
> prendere in input il file e restituire in output un file contenente o
> solo le righe "M" o solo quelle "F", con lo stesso ordine.

grep -E "^.{71}M" <in >out.m
grep -E "^.{71}F" <in >out.f

This e-mail (and any attachment(s)) is strictly confidential and for use only 
by intended recipient(s). Any use, distribution, reproduction or disclosure by 
any other person is strictly prohibited. The content of this e-mail does not 
constitute a commitment by the Company except where provided for in a written 
agreement between this e-mail addressee and the Company. If you are not an 
intended recipient(s), please notify the sender promptly and destroy this 
message and its attachments without reading or saving it in any manner. Any non 
authorized use of the content of this message constitutes a violation of the 
obligation to abstain from learning of the correspondence among other subjects, 
except for more serious offence, and exposes the person responsible to the 
relevant consequences.

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