On 2 May 2006, at 18:25, Timothy Murphy wrote:
> Talking of scripts, could you please tell me
> the simplest script to search through "refer-like" files
> with items separated by a blank line, eg
>> %n Tom
> %t 3
>> %n Peter
> %t 17
>> I'd like a script (in any known language), say "foo", so that
> "foo Tom" would print out
>> %n Tom
> %t 3
Well, so far we've had offers in perl, and a combo. of awk & shell,
but for the life of me, unless there's something Tim hasn't told us
(in which case presumably the other offers will also be wrong), I
don't see why anything more than
grep -A 1 Tom FILE
is needed.
Niall
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!