How to search through multiple xml files for the occurence of a string in between 2 tags in linux? -


i have around 100 xml files in there inconsistency of how euro sign (€) displayed character or (&euro).

first prove these 2 strings occured in same files, used grep :

grep -e "&euro" -e "€" -r /home/xml/ -o 

&amp;euro occurs between tags <conditions> , <directions>.

e.g.

<directions> text text text : price : 19.99 &amp;euro text text&amp;euro </directions> <conditions><tag><tag2> text text text &amp;euro text&amp;euro </tag2></tag></conditions> 

i search occurence of € sign in strings in between these tags.

how can achieve this?

here's how i'd element 'directions':

find . -name "*.xml" | xargs grep "<directions>.*\&amp;euro.*<\/directions>" 

same can applied 'conditions' element.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -