From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(2,720 Views)

This worked for me

 

Example.png

Tim
GHSP
0 Kudos
Message 2 of 8
(2,716 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,713 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,711 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,707 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,697 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,693 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,683 Views)