LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to search same but multiple result from multi-line string

Hi, I'm trying to figure out the fatest way to read a text file and reading specific patterns from it, i know that i can read the contents of a file all at once if i don't use read line from the "read from text file" control but how can i process the multi line result?
 
lets say i have a file that have this content:
 
line1a_43
line2b_12
line3a_32
line4a_53
line5b_32
line6a_23
 
i know that if you use read from text file, you'll be given a string result of
 
"line1a_43\nline2b_12\nline3a_32\nline4a_53\nline5b_32\nline6a_23"
 
now what should i do to be able to extract the numbers from each line that has "line\d+b" (line with any digit then a letter b)
 
using a pattern matching technique, i'm expecting to have a result either an array or a string with delimeters similar to this:
 
12
32
 
Thanks,
Peter A.
 
P.S. i know how to do this using read by line technique but if i'm reading a huge file, reading line by line will take longer.
0 Kudos
Message 1 of 6
(3,133 Views)
Here's one possibility (LabVIEW 8.5):
 
 
(The other case is "a", empty, with the array wired across.)


Message Edited by altenbach on 07-01-2008 06:52 PM
Download All
0 Kudos
Message 2 of 6
(3,118 Views)
Just a quick thought... hope it works 🙂
 
Regards.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 6
(3,115 Views)
Thanks for the sample, with this I was able to extract what i need in less than a second  (~400ms) on two files ~10MB), i made some improvement to it using the search/split string and made it ~200ms. originally it took me 8 seconds using the line by line technique.
 
thanks a lot,
Peter A.
 
 
 
 
0 Kudos
Message 4 of 6
(3,108 Views)

Hi Peter,

Will you share with us your code? No obligation however 🙂



Message Edited by ian fung on 07-02-2008 11:24 AM
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 5 of 6
(3,106 Views)

sure, here it is, i did however took it out from my full block.

there is also a portion of this code that enables me to block off duplicates.

Regards,

Peter A.

 

 



Message Edited by peter.a.azucena@intel.com on 07-01-2008 07:39 PM
0 Kudos
Message 6 of 6
(3,102 Views)