View previous topic :: View next topic
|
Author |
Message |
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
hi all,
i need to auotmate a process in rexx as part of the busniess need. in the below image i need to extract the value in the <noofrecords> tag, that is i need to extract the value '1'. Please let me know the rexx code to do this as this is routine work. |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
<feeamount>822.00</feeamount>
</feedetail>
<feedetail>
<expensecode>TER</expensecode>
<rateperunit>420.00</rateperunit>
<pricebasis>PA</pricebasis>
<chargedqty>1.00000</chargedqty>
<feeamount>420.00</feeamount>
</feedetail>
</feedetails>
</oceaninvoice>
</oceaninvoices>
<noofrecords>1</noofrecords>
</oceaninvoicedata> |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Code: |
string = "<noofrecords>123</noofrecords> "
parse var string "<noofrecords>" number "</noofrecords>"
say number
|
|
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
but the value <noofrecords>1</noofrecords> will not be the same always
so in that case what wil we do? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Read the file from the start until you encounter a "<noofrecords>".
move the enire record to "string".
Follow the method suggested by enrico. |
|
Back to top |
|
|
|