Need to parse file which returns a block of output and not just that line.
Any direction is greatly appreciated.
Say Input file is of the following format:
NAME: SCAN1
CONDITION: if(....)
and (....)
ACTION: z=2
NAME: SCAN2
CONDITION: if (...)
ACTION: y=5
x=2
NAME: SCAN3
CONDITION: if(.....)
ACTION: x=4
y=2
NAME: SCAN4
CONDITION: if(.....)
ACTION: x=4
Need to write a script which parses the above file and gives me the block of what NAME string was provided.
e.g: If Input SCAN2, output should be :
NAME: SCAN2
CONDITION: if (...)
ACTION: y=5
x=2
Then need to look it so I can pull multiple block of whatever input I provide.
e.g:
SCAN2
SCAN4
provides me with the following output:
NAME: SCAN2
CONDITION: if (...)
ACTION: y=5
x=2
NAME: SCAN4
CONDITION: if(.....)
ACTION: x=4