Shell script to calculate the max cpu usage from the main script

Hi All,
I have a script which does report the cpu usuage, there are few output parameter/fields displayed from the script. My problem is I have monitor the output and decide
which cpu number (column 2) has maximum value (column 6).
Since the output is displayed/updated every seconds, it's very difficult to capture the result.
Is there a way, we can write a seperate script, which read the output and display the cpu number and it's cpu usuage value(max) and output that data ?
script need to calculate/report the cpu and cpu value for every 1 sec set data
Main script :

PATH=/usr/bin:/usr/sbin:$PATH
export PATH
if [ "$1" != "" ] ;then
[ $1 -gt 0 ] && TIME=$1
else
TIME=1
fi
LOG_BASE=${LOG_BASE:-/usr/logs/}
HOST=`hostname`
[ -d $LOG_BASE/cap ] || mkdir -p $LOG_BASE/cap
if [ ! -f $LOG_BASE/cap/mpstat_${HOST}_`date '+%Y%m%d'`.csv ];then
echo "Date Time,CPU ID,User,System,Wait,CPU_Use" \
> $LOG_BASE/cap/mpstat_${HOST}_`date '+%Y%m%d'`.csv
fi
mpstat $TIME | while read r
do
echo "`date '+%Y/%m/%d %H:%M:%S'` $r" |nawk '$3 !~ /CPU/ \
{printf \
"%s %s,%d,%d,%d,%d,%d\n", \
$1,$2,$3,$15,$16,$17,100-$18 \
}' >> $LOG_BASE/cap/mpstat_${HOST}_`date '+%Y%m%d'`.csv
done

Main script output :

2013/08/09 09:44:09,0,1,2,0,3
2013/08/09 09:44:09,1,0,0,0,0
2013/08/09 09:44:09,2,0,2,0,2
2013/08/09 09:44:09,3,0,1,0,1
2013/08/09 09:44:09,4,0,1,0,1
2013/08/09 09:44:09,5,1,1,0,2
2013/08/09 09:44:09,6,0,1,0,1
2013/08/09 09:44:09,7,0,1,0,1
2013/08/09 09:44:10,0,1,1,0,2
2013/08/09 09:44:10,1,0,0,0,0
2013/08/09 09:44:10,2,1,1,0,2
2013/08/09 09:44:10,3,1,2,0,3
2013/08/09 09:44:10,4,0,0,0,0
2013/08/09 09:44:10,5,0,1,0,1
2013/08/09 09:44:10,6,0,0,0,0
2013/08/09 09:44:10,7,0,0,0,0
2013/08/09 09:44:11,0,1,1,0,2
2013/08/09 09:44:11,1,0,0,0,0
2013/08/09 09:44:11,2,0,2,0,2
2013/08/09 09:44:11,3,1,1,0,2
2013/08/09 09:44:11,4,0,0,0,0
2013/08/09 09:44:11,5,0,1,0,1
2013/08/09 09:44:11,6,0,0,0,0
2013/08/09 09:44:11,7,1,1,0,2

In the above output, there are 6 columns ie,
Date Time,CPU ID,User,System,Wait,CPU_Use
2013/08/09 09:44:09,0,1,2,0,3

from the above output, need to monitor which cpu(column 2 : 0-7 cpu) has utilized more say,
for 2013/08/09 09:44:09
cpu 0 has max cpu usuage value = 3
cpu 2 has max cpu usuage value = 2
for 2013/08/09 09:44:10
cpu 3 has max cpu usuage value = 3
cpu 2 has max cpu usuage value = 2
for 2013/08/09 09:44:11
cpu 2 has max cpu usuage value = 2
cpu 2 has max cpu usuage value = 2
Can any help me to sort this out please ?

Many Thanks

It is so CSV, you could use a flat file JDBC or ODBC on it, and SQL whatever report you want. I like to use SQuirreL with jdbc.
CsvJdbc - a JDBC driver for CSV files
J-Stels Products: StelsCSV - CSV Text JDBC, StelsDBF - DBF JDBC, StelsXML - XML JDBC, StelsMDB - MS Access JDBC, StelsEngine - in-memory JDBC
HXTT Text JDBC Drivers and CSV JDBC Drivers