LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

regexp to capture numbers

Solved!
Go to solution

Hello,

 

i have lines containing numbers looking like this : \s\s\s1025.205\s\s\s-0.002\s\s\s520.125\s\s\s0.001\s\s\s\s

 

number of \s to separate is not constant

 

which expression can i use to obtain numbers between "\s"  

 

Regards

 

Tinnitus

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 1 of 8
(3,004 Views)

This worked for me

 

Example.png

Tim
GHSP
0 Kudos
Message 2 of 8
(3,000 Views)

thanks

 

how can i add the sign  ?

 

Tinnitus

 

 

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 3 of 8
(2,997 Views)

@tinnitus wrote:

thanks

 

how can i add the sign  ?

 

Tinnitus

 

 

 

 


I do not understand your question?

 

Do you just want to add it to the result? If so just concatinat the result and the ?

Tim
GHSP
0 Kudos
Message 4 of 8
(2,995 Views)

Sorry,

 

with this regexp did you recover the minus of  -0.002 for exemple ?

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 5 of 8
(2,991 Views)
Solution
Accepted by topic author tinnitus

This one works sorry I did not notice that.

 

Example.png

Tim
GHSP
Message 6 of 8
(2,981 Views)

You can add [\+\-]? in front of aeastet first regex, alternate regex solution is [\+\-]?\d+\.\d+

 

alternate regex solution.png

 

Ben64

Message 7 of 8
(2,977 Views)

Presuming that you would want to perform some mathematical operations on the values, you may want to consider using "Scan from String"

 

scanfromstring.PNG


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 8 of 8
(2,967 Views)