Hi guys,
I am looking to write a script where I need to process many sets of transactions.
I want to process the set if $ 1 == "01" field $5 = "W", and $ 1 == "07" field $3 = "YY" otherwise copy set to output.
Example of the input file:
Code:
01 08 77 78 W 9890
02 08 66 68 0 8554
07 08 YY 85 9 7545
01 08 99 87 X 8787
04 09 85 85 4 8758
09 87 88 78 7 6584
10 84 ZZ 99 8 9887
A new set is always starting with $1 == "01".
Script should only process first set because its 5th value is "W" and put "MATCHED" in the end.
and copy the unmatched set "X" as it is to output.
Code:
Example of output file:
01 08 77 78 W 9890
02 08 66 68 0 8554
07 08 YY 85 9 7545
MATCHED
01 08 99 87 X 8787
04 09 85 85 4 8758
09 87 88 78 7 6584
10 84 ZZ 99 8 9887
and so on..
thanks for your help