Only the required tag information the XML file file

Hi

i have a single line xml file having many account no tag, from which i need only the account no from the tag. any one can help on this.

below is the xml file:

<OASAccountNo>01101908201USD</OASAccountNo><OASCurrencyCode>USD</OASCurrencyCode><OASAccountNo>01101908202USD</OASAccountNo><OASCurrencyCode>USD</OASCurrencyCode></OASAccountID><OAStaticInformation OASAccountType="CA" OASAccountStatus="O"><OASBranchId>037</OASBranchId><OASCountryCode>AE</OASCountryCode><OASAccountNo>01101908203USD</OASAccountNo><OASCurrencyCode>USD</OASCurrencyCode>

Expected output is:

01101908201USD
01101908202USD
01101908203USD

Thanks :slight_smile:
Saran

perl -wlne 'BEGIN{undef $/} while(/<OASAccountNo>(.*?)<\/OASAccountNo>/smg) {print $1} ;' infile.txt

;);):wink:

Hi ahmad, thanks its working fine.:slight_smile: