07-28-2014 10:13 AM
Hello Can anybody please help me out in this..??
I want to read data from a spreadsheet file as it is a look up table.
I want to create a program which lets the user enter an element which is be found in the data in the spreadsheet file and gives back the number which is to the adjoining column of the element in the spreadsheet file.
Example i have the following data in spreadsheet file:
Range Count
2 10
4 49
6 60
Etc.
If i enter 2 to search the data in the spreadsheet file, i do expect the program replies back with the answer 10 and so on...
Can anyone please help out...
Thanks in advance...
07-28-2014 10:20 AM
07-28-2014 10:30 AM
07-28-2014 10:49 AM - edited 07-28-2014 10:50 AM
@apok wrote:
Why autoindex the output? You should only have 1 output. Besides, the Search 1D Array is simpler (no loop needed).
07-28-2014 10:56 AM - edited 07-28-2014 10:59 AM
@crossrulz wrote:
@apok wrote:
Why autoindex the output? You should only have 1 output. Besides, the Search 1D Array is simpler (no loop needed).
might be 2 cases associated with that # and how does using a for loop make it any less simpler? is this a matter of opinion....wonder what the bench marks are?
07-28-2014 11:09 AM
Yes i have tried the data to be read using a csv file.
I even tried reading the data using a 1d array and sesrching the index so as i can link it with other part but the reult i found was always a 0 or -1.
07-28-2014 11:15 AM - edited 07-28-2014 11:15 AM
apok wrote: might be 2 cases associated with that # and how does using a for loop make it any less simpler?
Both methods are flawed. Tim's solution will not correctly work if no match is found.
The FOR loop version will return an array (possibly empty). Since the requred output is a scalar, it also does not solve the problem.
07-28-2014 11:22 AM
hello apok
can u just tell me which block have u used??
07-28-2014 11:37 AM
07-28-2014 11:41 AM
i am attaching the vi as zip file