dickiebird
Programmer
Further to previous thread re: Awk and Arrays
How can I load and print arrays when I load it thus :
$1 and $4 are unimportant
$2 is a date eg 23/04/98
$3 is alpha eg "$5 and $6 are numeric eg 4342 3422
DATUM=substr($2,7,2) substr($2,4,2)
VALUM=$5 - (substr($6,6)) + 1
arr[$3,DATUM] += VALUM
then to print :
for ????? in arr
print arr[????????]
I need to group my results thus :
9804 # The date ( though I'd prefer 04/98 )
33434 # Totals for each group
WTCCC 101
CCCEE 2000
9805 # Following month
34432
WTCCC 1002
CCCEE 10
etc
TIA Dickie Bird (-)))
How can I load and print arrays when I load it thus :
$1 and $4 are unimportant
$2 is a date eg 23/04/98
$3 is alpha eg "$5 and $6 are numeric eg 4342 3422
DATUM=substr($2,7,2) substr($2,4,2)
VALUM=$5 - (substr($6,6)) + 1
arr[$3,DATUM] += VALUM
then to print :
for ????? in arr
print arr[????????]
I need to group my results thus :
9804 # The date ( though I'd prefer 04/98 )
33434 # Totals for each group
WTCCC 101
CCCEE 2000
9805 # Following month
34432
WTCCC 1002
CCCEE 10
etc
TIA Dickie Bird (-)))