LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search for a specific string from an excel sheet

Thanks Ray, well it did actually find the string of the B126460 license plate, and getting its index, but if i use anyone of the other license plates in the file it is not giving me anything so maybe it is only reading the last line of the file? But logically if we trace your program it should scan for any license plate so i dont know where the problem lies.

So i thank you again and if we can find a solution for this problem it would be great.

 

I also tried a different approach on an excel file but it only returned me a row of data containing garbage values and not what the cells contain.

 

Thanks

Amin

0 Kudos
Message 21 of 40
(2,050 Views)

amt1981 wrote:

Thanks Ray, well it did actually find the string of the B126460 license plate, and getting its index, but if i use anyone of the other license plates in the file it is not giving me anything so maybe it is only reading the last line of the file? But logically if we trace your program it should scan for any license plate so i dont know where the problem lies.

So i thank you again and if we can find a solution for this problem it would be great.

 

I also tried a different approach on an excel file but it only returned me a row of data containing garbage values and not what the cells contain.

 

Thanks

Amin


It's not as simple as:

1) you just need a conditional terminal in the FOR loops to stop them is it? That's my usual reason for getting the last line instead of the one I want.

2) (other option) you need to transpose the array.

 

Disclaimer: I haven't run the code or tried to, Ray is normally pretty good, but even to good guys slip up occassionally. (If Ray's missed something, in the immortal words of South Park "Blame Canada" Smiley Wink )

 

James

Message Edited by James W on 04-29-2010 12:41 PM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 22 of 40
(2,035 Views)

I didn't have LV2009 at this PC so I rewrote the same thing in LV8.5.

 

It appears to work well.  I'm not sure what you are seeing.

 

Here is the block diagram and I attach the VI.

 

Message Edited by Ray.R on 04-29-2010 09:38 AM
Download All
Message 23 of 40
(2,025 Views)

 


James W wrote:

Disclaimer: I haven't run the code or tried to, Ray is normally pretty good, but even to good guys slip up occassionally. (If Ray's missed something, in the immortal words of South Park "Blame Canada" Smiley Wink )

 


 

 

Thanks James,

 

We all slip up.. 😉

But this one can't be blamed on Crazy Cannucks..  😄

 

Here are the results from running a search for the 3 license plate numbers.  It worked fine each time.

 

 

 

 

 

 

 

 

 

Message Edited by Ray.R on 04-29-2010 09:45 AM
Message 24 of 40
(2,022 Views)

Thanks Ray it is working pretty fine now. You really helped me. Your VI is working pretty well for all the License Plate i am extracting.

If i may ask you for another help it would be appreciated.

I am including with this message an excel library that it is provided on one of the forums, now i tried it, and it is extracting data from my excel file but it is giving me all the data found under the License Plates column, so if possible maybe you can help me search for my specific string of characters from within the array which contains all the License Plates that i already wrote in my excel file. I also attached the excel file i am using.

 

Thank you again for helping me.

 

Best Regards

Amin

Download All
0 Kudos
Message 25 of 40
(2,011 Views)

The library that you provided is the regular Excel functions.  

 

Did you attempt to write some code?  If you look at some of the examples in the forum, I seem to remember posting something similar to what you are looking for.

 

Start top implement a solution and I will help you along the way.

Message 26 of 40
(1,995 Views)

Ok,

 

I may have temporily lost the thread of this discussion at the moment but I will keep an eye on it to see if I can help.

2 Questions before I go quiet:

1) Can I just confirm that the VI worked in the 8.5 implementation, but not in the 2009 implementation - same BD? (Why?)

2) Ray, Do I see fuzzy wires in the FOR loop for the string input on your 8.5 implementation? - Is this "constant folding" turned on on your PC?

 

Ray - I wasn't seeking to blame the "Cannuks", I was blaming the scenery for distracting you from your desk! Smiley Tongue

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 27 of 40
(1,970 Views)

Hey Guys,

first i really wanna thank you for your help and ray for the vi examples you provided me, even though i didnt use them but they gave lots of insight to know where to put my thinking and solve my problem.

Now i have one final favor to ask of you, i attached a vi which my excel sheet for the license plate i extract and then for most it finds it, and then i made another search from within this excel file in order to extract some data concerning the car owner, what i am facing is that some times even though the license plates are found in the database, my program seems not to read the license plate and issues me an error message, and/or it finds the license and then at the index where the string was found it can't seem to extract data, or sometimes for a specific string it just extract few data not all i require.

So please if you could find me where the problem is i would really appreciate it.

I suspect that maybe because the Read Excel.vi that i used is openning and closing my excel sheet many times that it is causing my program not to work properly as it should.

 

Thanks again

 

Amin

Download All
0 Kudos
Message 28 of 40
(1,958 Views)

James W wrote:

Ok,

 

I may have temporily lost the thread of this discussion at the moment but I will keep an eye on it to see if I can help.

2 Questions before I go quiet:

1) Can I just confirm that the VI worked in the 8.5 implementation, but not in the 2009 implementation - same BD? (Why?)

2) Ray, Do I see fuzzy wires in the FOR loop for the string input on your 8.5 implementation? - Is this "constant folding" turned on on your PC?

 

Ray - I wasn't seeking to blame the "Cannuks", I was blaming the scenery for distracting you from your desk! Smiley Tongue

 

James


Answers:

 

1)  The original snippet had a bug.  I was distracted by the scenery and the brain went AWOL.  I should have wired to the index of the For Loop, not where it was found in the array.

I though I posted the improved snippet.  In case I didn't it is below.

 

2)  Yes.. I have constant folding turned on in LV8.5.

 

If I was working downtown Montreal, I would be very much distracted and totally useless to write any program..  😉  😛  LOL!

 

 

Message Edited by Ray.R on 04-30-2010 11:23 AM
Message 29 of 40
(1,955 Views)

amt1981 wrote:
first i really wanna thank you for your help and ray for the vi examples you provided me

Glad to help

 


amt1981 wrote:

what i am facing is that some times even though the license plates are found in the database, my program seems not to read the license plate and issues me an error message, and/or it finds the license and then at the index where the string was found it can't seem to extract data, or sometimes for a specific string it just extract few data not all i require.



 

 I won't have time to look at it before lunch, but will look at it this afternoon.

Message 30 of 40
(1,951 Views)