Hi All,
Can Someone help me in capturing a word from xml Using sed or awk or any other way in unix.
i have file abc.xml like this
<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
- <NREC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <HEADER>
<SOURCE>MAIL</SOURCE>
<MSGID>7971</MSGID>
<MESSAGETYPE>NRECAB</MESSAGETYPE>
<MESSAGEFUNCTION>NEWM</MESSAGEFUNCTION>
<REVID>30842</REVID>
<MARKET>US</MARKET>
<PROCESSINGDESK>01</PROCESSINGDESK>
<PREPDATE>20120123012446</PREPDATE>
</HEADER>
when i ftp'ed this file to unix it became single line like
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><NREC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><HEADER><SOURCE>MAIL</SOURCE><MSGID>797</MSGID><MESSAGETYPE>NRECAB</MESSAGETYPE><MESSAGEFUNCTION>NEWM</MESSAGEFUNCTION><REVID>30842</REVID><MARKET>US</MARKET><PROCESSINGDESK>01</PROCESSINGDESK><PREPDATE>20120123012446</PREPDATE></HEADER>
Now my requirement is to extract only " NRECAB" and "US" .
Please help me capture this particular words single or in separate commands.
Thanks in Advance,
Naveen kumar c