R
Ram
How do I search for just the ordsts start(<ordsts>) and end tags(</ordsts>)
and the data between them, and get just the last matched one. Also would
need an idea of how to get the last two matches.
Thanks for the pointers.
Sample Input file:
<logos>
<ordsts>
<gname>
</gname>
</ordsts>
<ordadd>
<aname>
</aname>
</ordadd>
</logos>
<customer>
<contact>
<pname>
</pname>
</contact>
<ordsts>
<name>
</name>
</ordsts>
<shipname>
<sname>
</sname>
</shipname>
</customer>
<ordsts>
<doc_hdr>
<type_code>ORDSTS</type_code>
<type_suffix>LE</type_suffix>
<direction>IN</direction>
</doc_hdr>
<ord_keys>
<ordno>200000</ordno>
</ord_keys>
<req_obj>
<obj>order_header</obj>
<obj>order_line</obj>
</req_obj>
</ordsts>
<order> <doc_hdr> <type_code>ORDER</type_code>
<type_suffix>LE</type_suffix> <direction>IN</direction> <client_da
a>User Supplied Data</client_data> <client_id>User Supplied
Data</client_id> <correlation_id>414D51204C45555343433033202020
040001EEE00042583</correlation_id>
<response_channel>CC.ORDER.REPLY</response_channel>
<correlation_id>41,4d,51,20,4c,45,55
53,43,43,30,33,20,20,20,20,40,0,1e,ee,0,4,25,83,</correlation_id>
<response_channel>LEUSCS01::CC.ORDER.REPLY.CS.S.Q</response_c
annel> </doc_hdr> <customer> <cus_num>3374831</cus_num>
<bill_to> <contact> <con_num>2</con_num> </
ontact> </bill_to> <ship_to> <address>
<adr_num>1</adr_num> </address> <taxwaregeocode> <
eocode>331003600</geocode></order>
<ordsts> <doc_hdr> <type_code>ORDER</type_code>
<type_suffix>LE</type_suffix> <direction>IN</direction> <client_d
ta>User Supplied Data</client_data> <client_id>User Supplied
Data</client_id> <correlation_id>414D51204C4555534343303320202
2040001EEE00042583</correlation_id>
<response_channel>CC.ORDER.REPLY</response_channel>
<correlation_id>41,4d,51,20,4c,45,5
,53,43,43,30,33,20,20,20,20,40,0,1e,ee,0,4,25,83,</correlation_id>
<response_channel>LEUSCS01::CC.ORDER.REPLY.CS.S.Q</response_
hannel> </doc_hdr> <customer> <cus_num>3374831</cus_num>
<bill_to> <contact> <con_num>2</con_num> <
contact> </bill_to> <ship_to> <address>
<adr_num>1</adr_num> </address> <taxwaregeocode>
geocode>331003600</geocode></ordsts>
and the data between them, and get just the last matched one. Also would
need an idea of how to get the last two matches.
Thanks for the pointers.
Sample Input file:
<logos>
<ordsts>
<gname>
</gname>
</ordsts>
<ordadd>
<aname>
</aname>
</ordadd>
</logos>
<customer>
<contact>
<pname>
</pname>
</contact>
<ordsts>
<name>
</name>
</ordsts>
<shipname>
<sname>
</sname>
</shipname>
</customer>
<ordsts>
<doc_hdr>
<type_code>ORDSTS</type_code>
<type_suffix>LE</type_suffix>
<direction>IN</direction>
</doc_hdr>
<ord_keys>
<ordno>200000</ordno>
</ord_keys>
<req_obj>
<obj>order_header</obj>
<obj>order_line</obj>
</req_obj>
</ordsts>
<order> <doc_hdr> <type_code>ORDER</type_code>
<type_suffix>LE</type_suffix> <direction>IN</direction> <client_da
a>User Supplied Data</client_data> <client_id>User Supplied
Data</client_id> <correlation_id>414D51204C45555343433033202020
040001EEE00042583</correlation_id>
<response_channel>CC.ORDER.REPLY</response_channel>
<correlation_id>41,4d,51,20,4c,45,55
53,43,43,30,33,20,20,20,20,40,0,1e,ee,0,4,25,83,</correlation_id>
<response_channel>LEUSCS01::CC.ORDER.REPLY.CS.S.Q</response_c
annel> </doc_hdr> <customer> <cus_num>3374831</cus_num>
<bill_to> <contact> <con_num>2</con_num> </
ontact> </bill_to> <ship_to> <address>
<adr_num>1</adr_num> </address> <taxwaregeocode> <
eocode>331003600</geocode></order>
<ordsts> <doc_hdr> <type_code>ORDER</type_code>
<type_suffix>LE</type_suffix> <direction>IN</direction> <client_d
ta>User Supplied Data</client_data> <client_id>User Supplied
Data</client_id> <correlation_id>414D51204C4555534343303320202
2040001EEE00042583</correlation_id>
<response_channel>CC.ORDER.REPLY</response_channel>
<correlation_id>41,4d,51,20,4c,45,5
,53,43,43,30,33,20,20,20,20,40,0,1e,ee,0,4,25,83,</correlation_id>
<response_channel>LEUSCS01::CC.ORDER.REPLY.CS.S.Q</response_
hannel> </doc_hdr> <customer> <cus_num>3374831</cus_num>
<bill_to> <contact> <con_num>2</con_num> <
contact> </bill_to> <ship_to> <address>
<adr_num>1</adr_num> </address> <taxwaregeocode>
geocode>331003600</geocode></ordsts>