I'm piping a file to awk in order to filter the required fields. The last column in the file will sometimes have spaces. In the example below consider the 'col4 -i' as the last column.
col1 col2 col3 col4 -i
There are no delimiters in the report except for spaces so having spaces in the last column is a dirty trick.
)
Anyway, if I want to return from awk $2 and $4 then I will not get all of the last field. I've been looking in my trusty Sed & Awk O'reilly book for a way to return $2,$4 and the remainder of the line but haven't found it. Is there a way to do this with awk?