On Wed, 2004-05-19 at 06:59, [EMAIL PROTECTED] wrote: > I am using the below command > > awk -F: ' $3 ~/bharghav/ { print $0 } ' data.file > > but this command produces both > Vijayb:12345:Vijay B bharghav > vijaya:12347:vijaya bharghavi > > what to if I want only record containing exactly the word "bharghav" > that is > Vijayb:12345:Vijay B bharghav
If you're trying to get the first line containing "bharghav", try this: perl -ne '/bharghav/ && print && exit' input_file but I'm getting the felling that's not you're looking for... right? Could we see the input file? (ok, maybe just lines 12345 - 12347) :-) jac -- Josà Alves de Castro <[EMAIL PROTECTED]> Telbit - Tecnologias de InformaÃÃo -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>