I have a file like this:
ID A56
DS /A56
DS AGE 56
And I'd like to print the whole line only if the second column starts with a capital letter.
Expected output:
ID A56
DS AGE 56
What I've tried so far:
awk '$2 ~ /[A-Z]/ {print $0}' file
Prints everything: capital letters are found within the second column.
awk '$2 /[A-Z]/' file
Gets a syntax error.
awk '$2~/^[A-Z]/' file
– Jul 25 '14 at 12:41