Hi everyone,
I need a help on Unix scripting.
I have a file is like this
Date Amt
20071205 10
20071204 10
20071203 200
20071204 300
20071203 400
20071205 140
20071203 100
20071205 100
20071205 10
20071205 300
20071203 10
20071204 100
20071204 100
20071205 700
I want to add all the Amt for a particular date and Return the Date having max amt.
So here is the consolidated total for individual dates.
20071203 710
20071204 510
20071205 1260
The script should return 20071205 for the above input since it has the max total amt
Can anyone provide the Unix shell script for the above requirement.
Thanks,
Charan.