LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to match strings

Hi,

I have three strings: WER4580U, NID8959T, FTK4797K in one column of my microsoft access database and three numbers:IO-23,DD-98,IL-33 in another column respectively.

My program is that if i key in WER4580U in my front panel, it will go and match the strings and give out IO-23. 

I can get upto this stage.

What i want to do is that

If the no. of matches of the string is greater than 4, it will match and give out the results.

If the no. of matches of the string is less than 4, it will go to another strings and match again until the no. of matches become less than 4 and give out the results.

for eg. the strings save inside my database is WFR4B8?U, and the one i key in is WER4580U, it will still match and give out the result IO-23.

for eg. the strings save inside my database are WFR4B8?U and NLB895?T and , and the one i key in is NID8959T, it will go and match with WFR4B8?U first and no. of matches is less than 4 so go and match again with NLB895?T and now no. of matches is greater than 4, so give out the result of DD-98.

 

I am quite new to labview so i don't know how to write such a simple program.

 

If someone can help that will be great .

Thanks for your help .

0 Kudos
Message 1 of 6
(3,083 Views)

This is similar to your previous, same way you can match the string, find the number of matches

if it meets your condition, find the index by using for loop and and then use index array to take the

corresponding string in second column.

Aarthi
0 Kudos
Message 2 of 6
(3,077 Views)

yes.. i have tried..but after i got the no. of strings, i don't know how to get corresponding string from second column.

 

0 Kudos
Message 3 of 6
(3,062 Views)

Hi Min 1992,

 

As Aarthi has mentioned, get the index where you find the string. Use same to get string from other column.

If you can post your code, we can show you how it can be done.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 6
(3,058 Views)

But my matching part is something like this.. my program only works when all the characters are the same..

I don't know how to add no. of matches part in it and give out the result if the no. of matches is greater than 4.

0 Kudos
Message 5 of 6
(3,052 Views)

One way to do is retrieve entire column from database and then you check the matches

or else use LIKE,OR conditions in SQL query to match in the database directly.

Sometimes query may change based on database.Ex: SELECT LotNumbers FROM CarsLocation WHERE LicenseNumbers LIKE 'EH%';

This query will retrieve license numbers which starts with EH.

 

 

Aarthi
0 Kudos
Message 6 of 6
(3,046 Views)