in my script i have a command which will sum a particular value of all the lines in a file not beginning with H or T .
I have given the following commands
where the array values
TRLR_CTRL_VAL_1[0] =98 and
TRLR_CTRL_VAL_1[1] =10 ( the positions of the amount to be summed )
but this is thrwoing an error :-
Syntax Error The source line is 1.
The error context is
/^[^HT]/{ >>> SUM+=substr($0,${ <<<
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
awk: 0602-500 Quitting The source line is 1.
pls tell me the solution .
do i have to intialize the position and length values in BEGIN?