Parsing Text Challenge
I'm working a solution to grab a small handful of specific Exchange rates from an XML feed. I'm having trouble trying to get the correct expression to grab just the rate number from within a piece of code.
Here is the code
<title>1 USD = 120.27574691 JPY</title>
<title>1 USD = 0.895421255 EUR</title>
I can get the number using the expressing below...
Right(Middle ( Untitled::source ; Position ( Untitled::source ; "<title>1 USD = " ; 1 ; 1 ) ; 24 );10)
But I think in order to find the correct rate I need to narrow it down from the other side starting with " JPY</title>"
In the expression it would be more like " " & $currencyCode & "</title>"
I've tried every which way but loose to get the expression and the text functions correct but I'm banging my head.
Thanks for any advice.
T = Untitled::source ;
p1 = Position ( T ; "<title>1 USD =" ; 1 ; 1 ) + 15 ;
p2 = Position ( T ; "JPY</title>" ; p1 ; 1 )
Trim ( Middle ( T ; p1 ; p2 - p1 ) )