awk - $9 and onwards

How can I get awk to print all fields from $9 and onwards?

Hi, try

awk '{sub($1".*"$8, ""); print}'

--- Post updated at 22:39 ---

else maybe

awk '{sub($1 ".*" $8 FS, ""); print}'

--- Post updated at 23:02 ---

awk '{sub(".*" $8 FS, ""); print}'

--- Post updated at 23:17 ---

It must be admitted that the above examples will work only if the content of the 8 fields will not be repeated in subsequent ones.

awk '{for (i = 9; i <= NF; i++) printf $i FS}'

--- Post updated at 23:26 ---

If the delimiter of the fields are whitespace is better to use sed

sed -r 's/(\S+\s+){8}//'

If the field separator is a comma then ...

sed -r 's/([^,]+,){8}//'

Hi locoroco,
The answer to your question really depends on what your field separator is, whether or not any of the first eight fields are empty, whether or not you need to maintain the exact text (including the input field separators) between the remaining fields when you print the results, and what version of awk you're using. Since we don't know the answers to any of the above questions, we can only make wild guesses.

The suggestions nezabudka provided might or might not work depending on the above unspecified constraints (and on the contents of various fields).

When starting a thread here, please always tell us what operating system you're using, what shell you're using, give us a complete description of what you're trying to do, give us a short sample input file and the exact output you hope to produce from that input, and show us what you have tried to do to solve the problem on your own.