I have a file which has text startin from ISA and ending as IEA. In the text file I am looking for two key items,
ST*850
CELORGS02
I have the following command to extract this
/usr/bin/gawk -v RS='ISA' '/ST\*850/ {print RS $0}'
Right now It only looks for the first one (ST*850). How I can change the command to look for both the key items at the same time and then extract the text.
I'm glad it worked but your sample data indicated that the two keywords were on different records, which is why I used "or" versus "and". You are also chaning your record separator so it's impossible for me to know which condition will work correctly without seeing exactly what your data is supposed to look like.