I'd like to find a text match "app1.ear" and print the lines above and below until certain makers/boundaries are found <app-deployment> and </app-deployment>.
Sample search match: app1.ear
Sample Imput Text:
<app-deployment>
<target>AppCluster</target>
<module-type>ear</module-type>
<source-path>deploy/app1.ear</source-path>
<staging-mode>nostage</staging-mode>
</app-deployment>
<app-deployment>
<target>AppCluster</target>
<module-type>ear</module-type>
<source-path>deploy/app2.ear</source-path>
<staging-mode>nostage</staging-mode>
</app-deployment>
Sample output:
<app-deployment>
<target>AppCluster</target>
<module-type>ear</module-type>
<source-path>deploy/app1.ear</source-path>
<staging-mode>nostage</staging-mode>
</app-deployment>
Thanks,
Rob
Rob Jordan
Sample search match: app1.ear
Sample Imput Text:
<app-deployment>
<target>AppCluster</target>
<module-type>ear</module-type>
<source-path>deploy/app1.ear</source-path>
<staging-mode>nostage</staging-mode>
</app-deployment>
<app-deployment>
<target>AppCluster</target>
<module-type>ear</module-type>
<source-path>deploy/app2.ear</source-path>
<staging-mode>nostage</staging-mode>
</app-deployment>
Sample output:
<app-deployment>
<target>AppCluster</target>
<module-type>ear</module-type>
<source-path>deploy/app1.ear</source-path>
<staging-mode>nostage</staging-mode>
</app-deployment>
Thanks,
Rob
Rob Jordan