LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
ClaudioH

Search 1D Array with wild cards or exact match.

Status: Declined

Any idea that has received less than 7 kudos within 7 years after posting will be automatically declined.

Hi,

 

My application uses a series of files to configure it self and I need to search in arrays to find which are similar to a given reference.

 

My solution is to use a for with a Match pattern VI and some logic to do the operation.

 

I believe that "Search 1D Array" would be faster than this implementation if it had the option to use wild cards ("*" and "?") as "element" input.

 

Other option would be include a flag "Exact match", by default set to TRUE to behave as is today or FALSE to stop on first occurrence of "element" in the array that contains it somewhere.

 

For example, if element = "ode" and array element = "model", it should set as a match if Exact match is set to FALSE.

 

Cheers.

CHCastro
4 Comments
Mr.Mike
NI Employee (retired)

I think this would be much better as a general search which took in a VI reference.  The VI would take in an element of the type in the array and output a boolean if it matched.   That would allow for searching complex data structures and the equivalent of searching with wild cards in strings.

-- Mike
Mark_Yedinak
Trusted Enthusiast

I prefer Mr. Mike's suggestion as well. This would be much more useful and extend the search capability.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
wevanarsdale
Member

You might consider using a database to store configuration information.  Databases are quite good at searching by pattern using the LIKE operator.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 7 kudos within 7 years after posting will be automatically declined.