Moving Part of a field to another field using AWK

Hi there,
I have a comma seperated file with nine fields

the fields are

rerate: "numberTX",field2,field3,field4,field5.....

I want to do this to the file

reate: "field5TX",field2,field3,field4,field5

I know I can do this using AWK, but the thing giving me fits is that I need to keep the first part of thr first field there. Anyone got any ideas how I would do this ????

Hi guys,
This is what I have so far

nawk 'BEGIN {OFS=","} $1="Rerate: "$15 {print} ' robtest.txt >robawk.txt2

but it is placing a comma after Rerate: - what am I doing wrong

Try !

nawk 'BEGIN {FS="," ;OFS=","} {$1="Rerate: "$5 ;print} ' robtest.txt >robawk.txt2

Jean-Pierre.

Hi Jean-Pierre,

That's great.. However I have another question, what if the Field seperator is a " as opposed to a , ?????

echo "a\"b\"c" | awk -F'"' '{print $1,$2,$3}' " enclosed in ' '

or
echo "a\"b\"c" | awk -F"\"" '{print $1,$2,$3}' " enclosed in " ", preceeded by a \

Cheers vish - knew I was missing something - thanks guys for all your help.