> -----Original Message-----
> From: Joe Echavarria [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 28, 2001 7:02 PM
> To: [EMAIL PROTECTED]
> Subject: Flat File
> 
> 
> Hi there,
> 
>    I have a flat file with the follwoing structure :
> 
>   city|name|phone|zip.
> 
>    The script save each row with "\n" at the end.
> 
>   If for example i wish to display all rows of the
> cities in Miami. That is city=Miami.
>   How can i do it ?
>   I have been trying regular expresions, but has not
> result yet.
>   Any ideas ?

Sounds like a job for grep:

   $ grep '^Miami\|' myfile

Or, the perl equivalent:

   $ perl -ne 'print if /^Miami\|/' myfile

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to