search text and and do some maths

Hey guys

I’m trying to do a search on a text file find the text that looks like

<E K=“Exposure” V=

get the number that is after the text and add .5 to it.

I’m getting lost in offsets any help would increasing my life expectancy :slight_smile:

Cheers

Hi,

try this


set t to "<A>
<E K=\"Exposure\" V=4"

set {TID, text item delimiters} to {text item delimiters, " K=\"Exposure\" V="}
set t to text item 2 of t
set text item delimiters to TID
set n to word 1 of t as real
display dialog (n + 0.5) as text

Great thanks the more I learn the more I realise I have along way to go.