select last field from a file

hi everybody

i would to select the last field of a file
here as you can see i select the field number 8

y=`cat sortie2 | grep "^[1-9999]"| grep "starting"| awk '{ print $8}'`

but line can containt more or less field in never know, i just know is the last one

so i wondering to know if is something like
y=`cat sortie2 | grep "^[1-9999]"| grep "starting"| awk '{ print $lastfield}'`

or a other solution
thank a lot

y=`cat sortie2 | grep "^[1-9999]"| grep "starting"| awk '{ print $NF}'

I'm not sure that the command "grep" is doing what you want.
This command selects lines starting with a digit (from 1 to 9).

If you want to select lines with field 1 between 1 and 9999, you can do:

y=`awk '$1 > 1 && $1 <9999 && /starting/ { print $NF }' sortie2`

Jean-Pierre.

thank a lot that works