Hi,
So I am trying to print the first row(header) first column alongwith the matched value. But I am not sure how do I print the same, by matching a pattern located in the file
eg
File contents
Name Place
Jim NY
Jill NJ
Cathy CA
Sam TX
Daniel FL
And what I want is to print the first column first row(i.e header) for Place matching CA
and the matched value row
o/p is
Name
Cathy CA
So I know with awk
awk /CA/ File
will give me just
Cathy CA
How do I get the first column title "Name"?