I am trying to write a script that searches my server in many .app files and outputs the contents between two strings-- only outputting what occurs between the two strings. I am able to do this with AWK and GREP however, the terms I need to search have escape characters so this is not working.
Here is the .dat file excerpt:
<List Variable name="lookups">
<Value>
<Value name="lookups" value="LSM_OPT"/>
<OTHER GARBAGE... >
<Value name="lookup_name" value="123_Done"/>
<OTHER GARBAGE... >
<Value name="lookup_name" value="XYZ_DONE"/>
<OTHER GARBAGE... >
</Variable>
<List Variable name="lookups_for_data">
<Value>
<Value name="lookups" value="LSM_OPT"/>
</Variable>
I need to find all the data between "List Variable name="lookups"' and "/Variable" and nothing else... part of the problem are the escape characters but also, there are other entries in the .dat files that I do not want to capture but they contain my original search value plus some additional data ... e.g. from above " List Variable name="lookups_for_data"".. I do not want these.
I have tried several awk and sed options but I think the problem is the escape characters. Any help will be greatly appreciated! Thanks for your help!!