append a line into a file in the top

hi,
My code is

#!/bin/sh

echo "\n\nPlease enter the month of the year(YYYYMM) : \c"
read date_rep

INPUT_L9_FILE=L9_Recharge_Description_EOM_$date_rep.csv

#This part is used to summarise Grand_Total, Balance_Total of file L9_Recharge_Description_EOM_${1}.csv.

awk -F","  '{if(NR!=1) { Grand_Total[$1] += $2;Balance_Total[$1] += $3; }}
END { for (s in Grand_Total) {printf " %s,%f,%f \n",s,Grand_Total, Balance_Total } }'  $INPUT_L9_FILE  >>   L9_Recharge_Description_summary_EOM_$date_rep.o

cat L9_Recharge_Description_summary_EOM_$date_rep.o|sort > L9_Recharge_Description_summary_EOM_$date_rep.csv

#This creating a directory by name and moving the outputs to the respective directory
mkdir summary_$date_rep
mv *_summary_EOM_$date_rep.csv summary_$date_rep

#This removes all the intermediate file with extension .o
rm -f *.o

Into my Input file :L9_Recharge_Description_EOM_200909.csv

L9_RECHARGE_DESCRIPTION,Grand_Total,Balance_Total
Breakage,0,27491.4

POS Recharge,10659.84,1516.93

PP Refund,81.01,91.29

Positive Adjustment,2052.24,554.26

Positive Adjustment Reversal,117.28,191.14

Recharge,129201.57,23396.38

Recharge Reversal,2821.36,2677.78

Transfer Increase,5402.11,951.89

Not give the complete file

Into my output file :L9_Recharge_Description_summary_EOM_$date_rep.csv

,680135.500000,14607180.900000
 Breakage,0.000000,151024.010000
 POS Recharge,59185.400000,7927.250000
 PP Refund,593.320000,625.200000
 Positive Adjustment Reversal,1166.560000,1466.920000
 Positive Adjustment,20456.650000,8413.810000
 Recharge Reversal,15924.230000,18501.520000

Now what change into the code should i make to put a header into the output file like this

Into my output file :L9_Recharge_Description_summary_EOM_$date_rep.csv

L9_RECHARGE_DESCRIPTION, Total of Grand total, Total fo balance total

,680135.500000,14607180.900000
 Breakage,0.000000,151024.010000
 POS Recharge,59185.400000,7927.250000
 PP Refund,593.320000,625.200000
 Positive Adjustment Reversal,1166.560000,1466.920000
 Positive Adjustment,20456.650000,8413.810000
 Recharge Reversal,15924.230000,18501.520000

Thanks .....

#!/bin/sh

echo "\n\nPlease enter the month of the year(YYYYMM) : \c"
read date_rep

INPUT_L9_FILE=L9_Recharge_Description_EOM_$date_rep.csv
echo "L9_RECHARGE_DESCRIPTION, Total of Grand total, Total fo balance total" >> $INPUT_L9_FILE

 ### Remaining code
,680135.500000,14607180.900000
 Breakage,0.000000,151024.010000
 L9_RECHARGE_DESCRIPTION,0.000000,0.000000
 POS Recharge,59185.400000,7927.250000
 PP Refund,593.320000,625.200000
 Positive Adjustment Reversal,1166.560000,1466.920000
 Positive Adjustment,20456.650000,8413.810000
 Recharge Reversal,15924.230000,18501.520000
 Recharge,726584.070000,133711.370000
 Transfer Increase,30390.900000,23733.490000
 Transfer Reduce,112904.550000,137071.640000

this is the output of this change

sorting is taking place into this so ?????

---------- Post updated at 03:41 PM ---------- Previous update was at 03:39 PM ----------

Not into the input file into the output file L9_Recharge_Description_summary_EOM_$date_rep.csv
the change is required

Becuase, you are sorting in your script.

cat L9_Recharge_Description_summary_EOM_$date_rep.o|sort > L9_Recharge_Description_summary_EOM_$date_rep.csv

Any other work around or change in code so i can manage the above . Only into the final output file i need the header .

#! /bin/sh

echo "\n\nPlease enter the month of the year(YYYYMM) : \c"
read date_rep

INPUT_L9_FILE=L9_Recharge_Description_EOM_$date_rep.csv

awk -F","  '{if(NR!=1) { Grand_Total[$1] += $2;Balance_Total[$1] += $3; }}
END { for (s in Grand_Total) {printf " %s,%f,%f \n",s,Grand_Total, Balance_Total } }'  $INPUT_L9_FILE  >>   L9_Recharge_Description_summary_EOM_$date_rep.o

cat L9_Recharge_Description_summary_EOM_$date_rep.o|sort > L9_Recharge_Description_summary_EOM_$date_rep_1.csv
echo echo "L9_RECHARGE_DESCRIPTION, Total of Grand total, Total fo balance total" >> L9_Recharge_Description_summary_EOM_$date_rep.csv
cat L9_Recharge_Description_summary_EOM_$date_rep_1.csv >> L9_Recharge_Description_summary_EOM_$date_rep.csv
#This creating a directory by name and moving the outputs to the respective directory
mkdir summary_$date_rep
mv *_summary_EOM_$date_rep.csv summary_$date_rep

#This removes all the intermediate file with extension .o
rm -f *.o
rm -f L9_Recharge_Description_summary_EOM_$date_rep_1.csv || true

Use this one. It should work.