Need some ideas here. I have a string that may look like "542.12 18.02 1 020.00 2.34" that I want to parse into seperate vars (with A_Space as delimiter). The problem is that the value 1020.00 is written on the form 1 020.00 so I get the vars 1 and 020.00. I can't come up with anything with RegExReplace cause as far as can understand from the documentation I have to replace the whole NeedleRegEx. Else I could have used " \d+( replaceonlythisspace)" as the "real" values always have a dot in it. I expect this could be done in some way within RegExReplace but I can't find something that says it does. I actually got it working now, but in a messy way:
nrofvaluesover1000 := 0
Loop , Parse , var, %A_Space%
{
if A_LoopField is Integer
{
nrofvaluesover1000++
thousands := A_LoopField
continue
}
nr := A_Index - nrofvaluesover1000
If (nr = nrofthewantedvalue)
{
if thousands is not space
{
MyValue := A_LoopField + 1000 * thousands
thousands := ""
}
else
MyValue := A_LoopField
MsgBox '%MyValue%'
break
}
else
thousands := ""
}
Sure there must be a neater way doing the same thing?