LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

match pattern

The match pattern vi is used in each of the attached vi's. In look for object in file. In finds, HIP 22910 and HR 4796 but not HIP 39 or HIP 5 in the file (also attached)
In Objects_Sub.vi, it finds end when its been passed HIP 22910 but when its been passed HR 4796 it outputs until the end of the file.

Help.
Thanks
0 Kudos
Message 1 of 6
(3,407 Views)
the problem is that your identifier is not always terminated with a /n.  In Look for Object in File, where you append the \n, change that to [\n,\r]+.  Then it will be on to your next problem. 🙂

Paul
Message 2 of 6
(3,397 Views)
As paul noted, your lines end in a random mix of \n\r, \r\n, etc.
 
Another solution would be to connect a TRUE diagram constant to the "convert eol?" input when you read the file. 🙂
 
It is not clear why you even need to search for the object with the \n appended. Can't you just skip the \n entirely?
 
(And I agree with Paul about upcoming problems. ;))
Message 3 of 6
(3,384 Views)
Okay. I added [\n,\r]+. That solved my first problem but not my second problem. Converting eol's didn't help.
The \n was added to the Object name to solve another problem in that I was picking up the top line of the file when then program starting running.
Blankc were being sent out and matching a blank in the file. (something like that anyway).
0 Kudos
Message 4 of 6
(3,374 Views)
because you are only sending out a partial string (IE past match) but you are telling your match pattern to start seaching where the text was originally found in the input string... So in your particular example, you are telling it to start searching past the end of the file after match string!  Instead of using that add a + to the end in the match pattern, re-reading this, I do not think I am clear... when you want to find the end of that segment use 'end+' instead of 'end' with an offset and it should find it happily.  (remember to remove the single quotes)
Now on with the show 😉

Message Edited by Stradis on 09-25-2007 12:13 PM


Paul
Message 5 of 6
(3,368 Views)
 


Paul <--Always Learning!!!
Stradis, Inc.
Need a studio grade High-Def or Std-Def MPEG decoder? Browse my sample VIs?

 
...and sometimes the over-flow helps the rest of us. Smiley Wink
 
Thank you Paul!
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(3,341 Views)