I'm looking for a simple way to print a specific field with awk while allowing for embedded spaces in the field.
Sample: Field1 Field2 "Field Three" Field4
I want to be able to do the equivalent to awk '{print $3}'
but getting "Field Three" as a single field not two.
Update: More specifically, I need to get later fields not $3 but the space in #3 is what's messing things up. The number of spaces between the quotes in $3 is variable. I'm just wanting to be able to treat what's between quotes as a single field even if not all fields are quoted. So, ignoring the spaces as field separators if between quotes.
See Question&Answers more detail:os