I need help counting the fields and field separators using Nawk

I need help counting the fields and field separators using Nawk.

I have a file that has multiple lines on it and I need to read the file 1 at a time and then count the fields and field separators and then store those numbers in variables. I then need to delete the first 5 fields and the blank spaces.

example:
45 21 * * * run_cron /temp "daily_files.ksh"

I want to read the file that has this line and then write it to a new file with a line that looks like this:
run_cron /temp "daily_files.ksh"

The problem is that the the first 5 fields (which is what I really want to get rid of) are not the same for each line I am reading.

Any help is much appreciated. Thanks

bash-3.00# cat /tmp/tmp
45 21 * * * run_cron /temp "daily_teri_files.ksh"
45 21 * * * run_cron /test "weekly_teri_files.csh"

bash-3.00# while read one two three four five rest; do
> echo $rest | sed 's/"$/;run_mbpro teri-daily-recon.r"/'
> done < /tmp/tmp
run_cron /temp "daily_teri_files.ksh;run_mbpro teri-daily-recon.r"
run_cron /test "weekly_teri_files.csh;run_mbpro teri-daily-recon.r"

Is this what you were trying to do? You don't have to use nawk.

Yes that is exactly what I want to do. I will check it out and make sure it works for my big file. Thanks for the help!

if its a very large file as OP mentioned, running each line through a while loop and echoing part of each through sed might not be that efficient. it might be better to eliminate the while loop and let sed iterate the file instead since sed is internally "looping" over files anyway.
Also, awk is specifically designed to process structured data so it understands fields. using awk might be more "appropriate" in OP's case.