Hi all...
I want to parse a xml filein unix .. Can i use SED or unix script to parse the xml file .. If so can anyone show a sample script that will parse the xml file ..
Thanks in advance,
Arun ,,,,
Hi all...
I want to parse a xml filein unix .. Can i use SED or unix script to parse the xml file .. If so can anyone show a sample script that will parse the xml file ..
Thanks in advance,
Arun ,,,,
Can you show the sample input and output required?
<guest>
<guest1> a1 </guest1>
<guest2> a2 </guest2>
</guest>
<guest>
<guest1> a3 </guest1>
<guest2> a4 </guest2>
</guest>
can u please give an example to parse the example ... Either by SED or by unix script.
Thanks in advance,
Arun ..
$ awk -v tag="</guest>" ' />.*</ { gsub("<[^>]*>","") ; str = str ? str " " $0 : $0 }
> $0 ~ tag { print str; str="" } ' file
a1 a2
a3 a4