|
Can I search columns and print lines?
Hi. First post here.
I'm relatively new to UNIX (Solaris8) and writing my first real script, but I seem to have hit a brick wall. The odd thing is that it seems like it should be a simple task....but not with UNIX apparently.
I've got a large text file: 14000 lines with 10 columns.
I want to search the file purely on column 8 for a particular word, but if that word occurs I want to print the whole line.
If I 'grep' for the word it will show up in the other columns too, but I'm only interested in occurances in column 8.
What I need is something like grep $8 <word> <filename> but of course that command doesn't exist. nawk only deals with columns and won't give me the whole line.
Is there any way I can do this?
Thanks
|