Hello
I have the following which although works, runs very slowly. Can anybody help with a better/faster approach?
i'm trying to find out the concurrent rate of transactions
Thanks.
input file
==========
start date/time , end date/time
0610060000580,0610060001000
0610060000580,0610060001000
0610060000590,0610060001000
0610060001020,0610060001040
0610060001030,0610060001040
0610060001040,0610060001060
0610060001040,0610060001060
Script
=======
cc=1
oldstart=o
for REC in $(cat $1) ; do
start=$(echo ${REC} | cut -d"," -f1)
end=$(echo ${REC} | cut -d"," -f2)
if [ $start != $oldstart ]
then
cc=1
fi
if [ $start = $end -o $start = $oldstart ]
then
let cc=cc+1
fi
echo "Concurrent rate at $start = $cc" >> $1.res
oldstart=$(echo ${start})
done
I have the following which although works, runs very slowly. Can anybody help with a better/faster approach?
i'm trying to find out the concurrent rate of transactions
Thanks.
input file
==========
start date/time , end date/time
0610060000580,0610060001000
0610060000580,0610060001000
0610060000590,0610060001000
0610060001020,0610060001040
0610060001030,0610060001040
0610060001040,0610060001060
0610060001040,0610060001060
Script
=======
cc=1
oldstart=o
for REC in $(cat $1) ; do
start=$(echo ${REC} | cut -d"," -f1)
end=$(echo ${REC} | cut -d"," -f2)
if [ $start != $oldstart ]
then
cc=1
fi
if [ $start = $end -o $start = $oldstart ]
then
let cc=cc+1
fi
echo "Concurrent rate at $start = $cc" >> $1.res
oldstart=$(echo ${start})
done