LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

remplacer un texte commencant par <0,00--- dans un tableau de texte

Solved!
Go to solution

this  is an example of my problem

 

 

0 Kudos
Message 11 of 18
(1,066 Views)

Here is a solution using regex (regular expressions)

 

Ben64

0 Kudos
Message 12 of 18
(1,053 Views)

Can you send me back your solution with the saving for version 8.5, because i cannot open.

 

Thanks for all

BEN

0 Kudos
Message 13 of 18
(1,040 Views)

Version 8.5 attached.

 

Ben64

0 Kudos
Message 14 of 18
(1,029 Views)
Solution
Accepted by topic author Bigben84

Note that with a some practice the whole code can be simplified by using regex. See attached.

 

Ben64

0 Kudos
Message 15 of 18
(1,025 Views)

Hi men,

 

looks cool for me but i don't understand how you did.do you have some paper to know how use regular expresion (<\s0,\d+    ;   ([\d|,]+)|(<\s0,\d+)    ;   ([\w|,]+\s){4}    ;   ^\d{2}[^\n]+)


Anyway thanks a lot men


Ben

0 Kudos
Message 16 of 18
(1,014 Views)

As you saw regex can be very usefull but I admit that at first sight they look more like hieroglyph than something you can easily use.

 

You can browse the forum looking for the posts containing "regex" or "regular expressions" to have an idea of where and how they can be used.

 

A good start is to look at the tutorial and getting started sections of the following site: http://www.regular-expressions.info/

 

As an exemple: ^\d{2}[^\n]+ will match a string that starts with 2 digit character followed by the longest possible string of characters that are not a newline character. This will extract all the lines of interest (the ones like "11 He Helium .....).

 

<\s0,\d+ match want you want to replace by 0: the less than sign followed by a space, a comma and one or more digit character.

 

([\w|,]+\s){4} match one or more word character or comma followed by a space and this is repeated 4 time. This match the extracted string part just before your value of interest so the string after match portion of the "Match regular expression" function will start with the value of interest.

 

Finally: ([\d|,]+)|(<\s0,\d+) will match (one or more repetition of a digit or comma) or | (the less than sign followed by a space, a comma and one or more digit character) , your value of interest.

 

Ben64

0 Kudos
Message 17 of 18
(1,004 Views)

HI men, Thank you very much for all this explanation.

 

It's a very good Forum.

 

And hat because there is nice people like you

 

BEN

0 Kudos
Message 18 of 18
(995 Views)