Hi, niketnilay
Many thanks for your reply. I could get XML data with using spath.
However, it didnt work for another sample XML data it has some "Count" value.
Here is another XML sample.
<?xml version="1.0" encoding="Shift-JIS"?><Root><DataArea><Businessname>12347</Businessname><Contractcd>ABC1234567892</Contractcd><ReceptNumber>C12347</ReceptNumber><ChargeList><Charge><Ratingname>Contract</Ratingname><Aprice>800</Aprice><Count></Count></Charge><Charge><Ratingname>Product</Ratingname><Aprice>0</Aprice><Count>100</Count></Charge><Charge><Ratingname>Base</Ratingname><Aprice>4500</Aprice><Count></Count></Charge><Charge><Ratingname>Exchange</Ratingname><Aprice>1000</Aprice><Count>50</Count></Charge><Charge><Ratingname>Cabling</Ratingname><Aprice>10400</Aprice><Count></Count></Charge></ChargeList><PreviousALService></PreviousALService></DataArea></Root>
and this is a search I executed
source="Samle_XML_for_answers3.xml"
| spath output=Ratingname path=Root.DataArea.ChargeList.Charge.Ratingname
| spath output=Aprice path=Root.DataArea.ChargeList.Charge.Aprice
| spath output=Count path=Root.DataArea.ChargeList.Charge.Count
| eval Charge=mvzip(mvzip(Ratingname, Aprice, ","), Count, ",")
| mvexpand Charge
| eval Charge=split(Charge,",")
| eval Ratingname=mvindex(Charge,0)
| eval Aprice=mvindex(Charge,1)
| eval Count=mvindex(Charge,2)
| table Ratingname, Aprice, Count
Then, I only get 2 records with inproper "Count" values
Ratingname Aprice Count
1 Contract 800 100
2 Product 0 50
I expected to get 5 records
Ratingname Aprice Count
1 Contract 800
2 Product 0 100
3 Base 4500
4 Exchange 1000 50
5 Cabling 10400
Can you please let me know how can I get all the 5 record values..
Thanks
... View more