My output from the command is something like this:
1540 "AB" 6 "C" 119 "D"
The first column always has a number followed by a space, then a line with two quotes.
My goal is to get only the second column, for example:
"AB" "C" "D"
I intended to use <some_command> | awk '{print $2}' <some_command> | awk '{print $2}' to accomplish this. But the question is, some values ββin the second column contain space (s), which by default is the default delimiter for awk to separate fields. Therefore, the output is corrupted:
"A "C" "D"
How to get the pure value of the second column (with double quotes)?
shell awk ksh
Qiang Xu Apr 21 '13 at 22:36 2013-04-21 22:36
source share