LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arrays and spreadsheets.

I need to search a column of an array for a match to a string; please tell me if I got it right. I write the spreadsheet to an array and then use index array to search the column. Should I just use a for loop for searching or are there any search routines availible?

Thanks
0 Kudos
Message 1 of 6
(3,103 Views)
that depends.  Is there any possiblity of the text your looking for being in any of the other columns?  What are you going to do after you find the matched string?  The reason I ask is that if you are looking to match something in Column A, then take the rest of the data in that row.  You can avoid creating a 2d array.  And use the match pattern to find your data, then extract the rest of the data to the EOL char.  Thus avoiding the 2d array altogether.  See here for an example of what I mean LV8.2.1

Paul
Message 2 of 6
(3,096 Views)

Yes take the 2-d string array, index the column and use search 1d array (array pallett).  If you need case insensetive, then use the to upper function on the and search for the upper case version.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 3 of 6
(3,094 Views)
I'm running version 7 so unfortunately, I couldn't open your example.
I will need other items in the row but not the whole row.
0 Kudos
Message 4 of 6
(3,090 Views)
what you see in the HUGE text box is a tab delimited spreadsheet.  Each item in Col A is unique, so I search for that text, then extract the other info up to the EOL char.  so I have not allocated memory for the string twice... Once for the string itself, and once for a 2D array. 


Yes for the sharp shooters out there, I know I could have made it an array to start with.  but If the user who wanted this example needs to, they can download this directly from MS and not have to worry about future MS locale expansions!

Message Edited by Stradis on 10-01-2007 09:44 AM


Paul
0 Kudos
Message 5 of 6
(3,084 Views)
Thanks.
It will take me awhile to go through this.
0 Kudos
Message 6 of 6
(3,072 Views)