Search a specific field in a table
Posted on 2004-10-01
I'm trying to use grep to searh for a string in a table. However I need to limit the search to a specific field as I dont want any results from the first field if it contains the string. Then I need to print a few of the fields from the lines that contain my string in the field I need to search on. Here's an example of my data:
Toteve Sam Denver
Denver John Aspen
Ellis Joe Witchita
Toms Mary Denver
I want to search column 3 for Denver, but not pick up the John Denver line as I'm only searching column 3. It's easy in awk, but I cant use awk... Do I use Grep....I dont see how I can use Grep.