LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search for a specific string from an excel sheet

Hi,

I created a License Plate Recognition software using labview, now after i extract the characters from the image, i need to scan for the string obtained from the OCR session from an excel file where the license plate characters are pre-entered. So i want the program to actually search within this excel sheet for the set of characters obtained from the image and if a match is found to give me a message telling me that this license plate is available in the excel sheet. And then i need to extract from the excel sheet some data regarding the car model and color, and etc... and display tem to the user.

The problem i am facing is that i am not able to do the task described above because i am new to LabVIEW programming and therefore do not have the exact knowledge to manupulate the functions and block diagrams to get the result needed.

So if anyone could be helpful it would be very much appreciated.

 

Thanks in advance

Amin.

0 Kudos
Message 1 of 40
(6,381 Views)

Two questions:

 

  1. Is the "excel file" an .xls file or a deliminated text file?
  2. Is this project intended to be used by tax collectors to find people by passively scanning license plates?

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 40
(6,366 Views)

Hi Jim,

 

First thanks for replying, second no the project is not intended for tax collectors to passively scan for license plates(lol), it is intended for parking management in order to help security personnel to identify cars accessing the parking areas of a facility such a university parking area.

 

The Excel file is a .xls and i need to make my program search for the extracted string from the excel sheet i have and then when found display a message such as "Registered Car" and then from the field where the license plate has been found by the program it should also extract the car model information and the name of the car owner and his/her status inside the facility (Like: student or instructor) already set in the excel file.

 

Thanks

0 Kudos
Message 3 of 40
(6,360 Views)

"The file is XLS"

 

Next Q: 

Does it have to be XLS, or is it just XLS for the convenience of the university? - It makes it a heck of a lot easier for you of it's a delimeted file. If you can persuade the Uni to change the file format, you've just saved yourself hours (maybe days) of debug.

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 4 of 40
(6,355 Views)
There's a good example in the NI Developer Zone here; it should give you what you need as far as reading the Excel spreadsheet.  All you'll have left to do is find your data.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 40
(6,344 Views)

Hi Jim,

Sorry for my late reply, well actually i have no problem if i use a delimited file, it is just a file where i need to input specific data and make it like a database and then search for the license plate from within the file and extract some other info too. But maybe if i need to make the file usable by users to update the fields then i have to use an XLS file. But for the time being if you can guide on how to do the task i am asking for using a delimited file then i would be thankful again for your assistance.

 

Thanks for the link and thanks for your assistance

Amin

0 Kudos
Message 6 of 40
(6,324 Views)

If you use a delimited file, just read in the whole file using the Read from Spreadsheet string VI found in the File IO pallete and wire in your delimeter and file path, index out your column (probably) of number plates and pass the column into a FOR loop that contains a search function to search for the match. Stop the loop  when you find a match, pass out the boolean "match found" so you know if you have a match, index of the loop = row of the array with the data for that numberplate in it.

 

(Jim's probably got a different way, but I'm not sure if you have the full reg number, so I can't recommend using the search 1D array function unless you do. - don't forget to process white space.)

 

James

 

 

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 7 of 40
(6,310 Views)

Have a look at the attached code snippet (example).

 

There are two ways of doing the search.  Assuming you are searching by license plate number, you can get the index of the row in the data file.  Or you can get the row of data as shown in the bottom For Loop.

 

I also attach the "mock data file".

 

 

Message Edited by Ray.R on 04-26-2010 08:34 AM
Download All
0 Kudos
Message 8 of 40
(6,302 Views)

Dear Jim,

Sorry for my ignorance in labview but may i ask u where can i find the blocks of index and array that u wired after the for loops :$ am really sorry but as i mentioned to you before am still new to labview programming!!:D

 

0 Kudos
Message 9 of 40
(6,287 Views)
Hehehe how stupid of my part!! It is only the icon of the constant!!! i didnt paid attention!! LOL
0 Kudos
Message 10 of 40
(6,285 Views)