From: peter.a.azucena on
I tried to look for a solution to this but I haven't got any yet, I just started labview and I am trying to do a simple data extraction ui.
 
Basically if i have an array of strings, i'd like to filter out specific items from it using pattern matching then dump it to another array.
 
I tried with a simple for loop but it adds empty strings to my second array.
 
The array was supposed to contain this strings and i just want to pull out the ones with 5_visualid_.

 
2_test1
3_test2
4_test5
5_visualid_unit1
2_test1
3_test2
4_test5
5_visualid_unit2
2_test1
3_test2
4_test5
5_visualid_unit3
 
thanksMessage Edited by peter.a.azucena(a)intel.com on 05-06-2008 10:26 PM


Extracting specific data from array1.vi:
http://forums.ni.com/attachments/ni/170/321594/2/Extracting specific data from array1.vi
From: Dennis Knutson on
Try this. Your problem is that the function either returns the string you are looking for or an empty string. The case statement will create an array of only those strings where the search is successful. The modified VI is pretty similar to the shipping example called Separate Array Values in the Fundamentals>Arrays and Clusters section


ExtractingSpecificDataFromArray_mod].vi:
http://forums.ni.com/attachments/ni/170/321599/1/ExtractingSpecificDataFromArray_mod].vi
From: parthabe on
I think you cannot search an array for varying elements using the Match Pattern function & delete them.
Maybe you can see the VI attached to get an idea of how to do it. :smileyhappy:


Search n Delete Specific Elements.vi:
http://forums.ni.com/attachments/ni/170/321605/1/Search n Delete Specific Elements.vi
From: peter.a.azucena on
both examples are great. thanks a lot!
From: parthabe on
Just always rt-click your control & Make Current Values Default & then save the VI before posting it in the forums.
This will ensure that we can have your test data ready. :smileyhappy:
 
No need to type them in the post literally. :smileywink: