I need to find the 'number' of occurrences of particular words (C7STH, C7ST2C) that come in the output of a command. The command starts and ends with a 'fixed' text - START & END like below. This command is repeated many times against different nodes in the log file.
...
START
SLC ACL PARMG ST SDL SLI
0 A1 17 C7STH-1&&-31 MSC19-0/RTLTB2-385
1 A1 17 C7STH-65&&-95 MSC19-0/RTLTB2-1697
SLC ACL PARMG ST SDL SLI
0 A2 0 C7ST2C-4 ETRC18-0/RTLTB2-417
1 A2 0 C7ST2C-5 ETRC18-0/RTLTB2-449
2 A2 0 C7ST2C-6 ETRC18-0/RTLTB2-961
...
END
....
I am using flip-flop operator (if (/^START$/ .. /^END$/)to get each command output. Now
Is there a way to do 'grep' on this data without going line by line? Like can i get all the text between 'START' and 'END' into an array and do 'grep' on this etc?
Also is it 'ok' to have multiple levels of if blocks with flip-flop operator from performance point of view?