LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 2009 'Match Pattern' Issue

Hi All

We have just updated to Labview 2009 from 8.5 and a previously working vi  (attached) will not work. Basically I have hundreds of results files stored in C:\tmp from which I strip out individual test results and write them to excel. This all worked perfectly for months with Labview 8.5, but since updating to 2009 I'm finding that the string function 'Match Pattern' is not working as it should. e.g. below is a sample of text to be found in one of the results files:

 

2.2.1   Measure Vshunt & current for +3V3A    149.0817 180  -  LE Passed
2.2.1   Measure Vshunt & current for +6V8A    134.8424 200  -  LE Passed
2.2.1   Measure Vshunt & current for +3V3D    0.2260  1  -  LE Passed
2.2.1   Measure Vshunt & current for +5VA     417.3831 520  -  LT Passed
2.2.1   Measure Vshunt & current for +15VA    11.0523  20  -  LE Passed
2.2.2   Board Serial Number                   123456     Passed
2.2.3   Measure +3V3A                         3.2630 volts  3 3.6 GELE Passed
2.2.3   Measure +3V3 Quiet                    3.2780 volts  3 3.6 GELE Passed
2.2.3   Measure +5V Quiet                     5.0225 volts  4.6 5.4 GELE Passed
2.2.3   Measure +5VA                          5.1225 volts  4.6 5.4 GELE Passed
2.2.3   Measure -5VA                          -5.0791 volts  -5.4 -4.6 GELE Passed
2.2.3   Measure +3V3D                         3.2940 volts  3 3.6 GELE Passed

 

When I input '2.2.1   Measure Vshunt & current for +3V3A' as a search expression it is not found in any file. I have even cut and pasted the above example text into a constant and searched that and got the same 'not found' result.

 

Can anyone see anything obvious please?

 

Regards

IanR

 

 

 

 

0 Kudos
Message 1 of 3
(2,476 Views)

I think it is the '+' sign that is the problem. I've just tried removing the '+' sign from the search expression and modified a results file to match and it worked.

 

IanR

0 Kudos
Message 2 of 3
(2,461 Views)

The + sign is a special character use in regular expressions. The match pattern vi will match the longest string that contain the expression before the + sign (the + mean that the character just before it can be repeated one or more time, in your case it is a space just before the +).

 

What you can do is use the escape character (\) before the + sign so it will not be interprated as a special character.

 

Have a look at the help for the match pattern vi and also click on the special character link for more details on the + character.

 

'2.2.1   Measure Vshunt & current for \+3V3A'

 

note: you may also have to add \ before the periods in 2.2.1, the period is also a special character.

 

 

Ben64

0 Kudos
Message 3 of 3
(2,433 Views)