dickiebird
Programmer
Hi Guys
I have a long-winded Awk script which I now need to enhance.
I need to create sub-totals from a file for several date ranges (eg Pre March 1999,March 1999 to Sept 1999, Sept 1999 to March 2000 etc etc)
I have 5 different values to total for each date range :
File sample: (3 of 2million+ rows)
E08308311,8330,WWTV,GBP,50,I,05/02/01,03/02/01,1069,24/08/01
E08308331,8350,WWTV,GBP,5,I,27/03/01,24/03/01,0866,0,
E08308351,8355,WWTV,GBP,10,I,09/01/01,05/01/01,0310,11/07/01
Will Awk allow arrays to which I can refer ?
Perhaps such as : TotArr [][] ??????
where TotArr[0][0] holds my running total for Pre March 1999 £5 values
and TotArr[0][1] holds my running total for Pre March 1999 £10 values
and TotArr[0][2] holds my running total for Pre March 1999 £50 values
etc etc
and TotArr[8][0] holds my running total for March 2002 £5 values
and TotArr[8][1] holds my running total for March 2002 £10 values
etc etc
And how do I initialize it at the start ?
Thanks in advance Dickie Bird (-)))
I have a long-winded Awk script which I now need to enhance.
I need to create sub-totals from a file for several date ranges (eg Pre March 1999,March 1999 to Sept 1999, Sept 1999 to March 2000 etc etc)
I have 5 different values to total for each date range :
File sample: (3 of 2million+ rows)
E08308311,8330,WWTV,GBP,50,I,05/02/01,03/02/01,1069,24/08/01
E08308331,8350,WWTV,GBP,5,I,27/03/01,24/03/01,0866,0,
E08308351,8355,WWTV,GBP,10,I,09/01/01,05/01/01,0310,11/07/01
Will Awk allow arrays to which I can refer ?
Perhaps such as : TotArr [][] ??????
where TotArr[0][0] holds my running total for Pre March 1999 £5 values
and TotArr[0][1] holds my running total for Pre March 1999 £10 values
and TotArr[0][2] holds my running total for Pre March 1999 £50 values
etc etc
and TotArr[8][0] holds my running total for March 2002 £5 values
and TotArr[8][1] holds my running total for March 2002 £10 values
etc etc
And how do I initialize it at the start ?
Thanks in advance Dickie Bird (-)))