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\" Field
You can do this if the double quotes are always there:
awk -F\" '{print $2}'
Specifically, I am telling awk that the fields are separated by double quotes, at which point the part you want is readily available as field 2.
If you need to get at subsequent fields, you can split the remainder of the line on spaces and get a new array, say F[] of fields, like this:
awk -F\" '{split($3,F," ");print $2,F[1],F[2]}' file
Field Three Field4 Field5
assuming your file looks like this:
Field1 Field2 "Field Three" Field4 Field5 Field6