script for taking the stats from a file
i have file which contains data like this every day.i need to pull up a report for counting the 203's in that file for each subscriber id.there are around 200 subscriber id's. all ths Y's which i have written in the script are the subscriber id's.could some one give me an idea as to how do it in a better way.
more 09031000010202.TL
203,0903100000042C,710,29,3,
207,0903100000042C,670,133,1
207,0903100000042C,26,9,7,09
207,0903100000042C,42,61,1,0
207,0903100000052C,710,29,7,
207,0903100000052C,50,7,7,09
207,0903100000052C,218,22,1,
207,0903100000052C,36,25,7,0
203,0903100000052C,720,24,3,
203,0903100000052C,36,79,3,0
Script:
#!/bin/sh
set -x
thisday =`date +%y%m%d00010202.TLG`
for Y in 2 144 9 129 16 37 42 45 87 104 53 40 62 63 51 158 18 19 20 21 50 67 82 116 64 100 141 168 170 171 49 84 85 35 34 70 61 69 8 26 27 28 78 79 32 33 10 11 130 25
36 47 57 200 173 6 46 48 55 56 72 118 22 13 110 109 203 29 80 12 660 222 696 664 666 669 670 671 672 674 675 676 677 39 207 208 209 210 211 212 680 681 682 43 683 59 6
84 103 659 205 91 689 690 692 30 215 216 217 218 697 698 700 52 174 705 706 707 220 708 710 711 712 713 714 715 716 717 718 719 720 721 722 23 31 724 219 77 88 17 66 7
30 83 68 120 96 5 667 678 679 685 186 15 726 733 728 731 732 734 221 736 94 95 97 99 41 74 65 105 738 98 38 73 7 4 739 44 740 112 113 114 14 3 1 24 54 81 58;
do
echo "$Y 203's = ";`cat $thisday | grep ^203 | grep "2C,$Y, | wc -l`; done