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
&euro
occurs between tags <conditions>
, <directions>
.
e.g.
<directions> text text text : price : 19.99 &euro text text&euro </directions> <conditions><tag><tag2> text text text &euro text&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>.*\&euro.*<\/directions>"
same can applied 'conditions' element.
Comments
Post a Comment