Shell script is required

Dear All

I have a filelisting as below:

abcd_20110715_0007
abcd_20110715_0010  
abcd_20110716_0001  
abcd_20110716_0004
abcd_20110715_0008  
abcd_20110715_0011  
abcd_20110716_0002  
abcd_20110716_0005
abcd_20110715_0009 
abcd_20110715_0012  
abcd_20110716_0003 
abcd_20110716_0006

There are 12 files, 6 of them from 15th July and remaining from 16th July

I need a shell script which provide the following output as below format:

Current Time FileDate No.of Files
--------- ------------- -------------

20110716 13:21         20110716               6
20110716 13:21         20110715               6

I am expecting a reply from you

Thanks
AT

Try:

ls | awk -F_ '{a[$2]++}END{"date +\"%Y%m%d %H:%M\""|getline d;print "Current Time FileDate No.of Files\n--------- ------------- -------------";for (i in a){print d" "i" "a}}'

Thanks a lot

awk -v d="`date +"%Y%m%d %H:%M"`" -F _ '{a[$2]++}END{for (i in a) print d,i,a}' infile