filename change with awk needed

Hi,

i have files which contains list of csv file names
say temp.txt contains below like data

Dns_bangalore_08172011.093033.1139.csv
Dns_bangalore_08172011.093133.1139.csv

now i want to insert some string before .csv in the filename

say i want to insert string _sim1 beofre .csv as looks like below

Dns_bangalore_08172011.093033.1139_sim1.csv
Dns_bangalore_08172011.093133.1139_sim1.csv

any help with awk ??

Thanks,
Raghav

Try this:

awk -F"." '{s=$0; $(NF-1)=$(NF-1)"_sim1"; system("mv " s " " $0)}' OFS="." temp.txt

Thanks Franklin it works fine !!

try this:

sed -i 's/.csv$/_sim1.csv/g' a.txt