This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: grep and words


prz wrote:
> another question from newbie ..
> is it possible with grep to select only the rows where the second word
> applies, because the pattern can occur at different places like :
> row 1 : xxxx yyyy zzz
> row 2 : yyyy xxxx zzz
> I need only the row where word 2 = yyyy
> grep yyyy would also return row 2
> Thanks for all info
> Best Regards, Guy Przytula

Ditto that this is not a cygwin question per say.

I would use awk.

awk '$2 = "yyyy"' filename


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]