Reputation: 130
I have around 100 xml files in which there is an inconsistency of how to euro sign (€) is displayed as the character or as (&euro
).
First to prove that these 2 strings occured in the same files, i used grep :
grep -e "&euro" -e "€" -R /home/xml/ -o
&euro
only occurs between the tags <conditions>
and <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 would like to search for the occurence of the € sign in any strings in between these tags.
how can I achieve this?
Upvotes: 0
Views: 1073
Reputation: 1483
Here's how I'd do it with element 'directions':
find . -name "*.xml" | xargs grep "<directions>.*\&euro.*<\/directions>"
Same can be applied to 'conditions' element.
Upvotes: 1