11-12-2010 09:28 AM - edited 11-12-2010 09:28 AM
Hello All,
Want to search a word in column and after that word want to read the values till i encounter blank cell, uptill this i could get the code but then in same column again i have to search for same word and again start reading.
In short if i encounter word "Name" three times in one column i must start reading after that immediately three times till next very blank cell.
I am attaching code and my .xl file.
Hope anyone could guide me...
Thanks a lot...
pals
Solved! Go to Solution.
11-15-2010 03:51 AM
Hi pals,
1) Do you know how many times the word is going to appear in the excel sheet? You can use that as a counter and search accordingly.
2) secondly,If you know exactly how many blank spaces will be there between your data(After First appearance of word) and next appearance of the word, you can run your while loop accordingly. I this case You need to keep last position in the memory and start searching after that position.
3) If you know How much data you need to read (for e.g.. A1 to H45). You can read that data at once, get particular column from where you want to search word and run for loop.(This is better option)
I hope This will help.
Best of Luck
11-15-2010 07:48 AM - edited 11-15-2010 07:53 AM
Hi Gaurav,
Thanks but nothing is fixed in this... as on survey of month the excel-sheet will be filled and then so that name can occur once or twice or thrice also... And no of blank spaces is also not sure plus how much data i need to read is also not sure i mean not same always... So i am bit confused and i tried but i was not able to code further...
Thanks once again..
pals
11-15-2010 08:57 AM
In that case how are you going to decide when to stop? I think there will be some EOF kind of parameter.
11-15-2010 09:26 AM
Hi Gaurav,
Ya thats what the probelm is that nothing is fixed.... There are six headers and there column number is fixed.
It should take 1st header search in column A if the word "Name"Comes twice it should read twice just below the header Name all the exciting values, then it should go for other Header "Gruop" in Column B and do the same. And this should be done for all six headers.
Eg:
A B C D E F G ------ Column number from excel
Group Number Name Rate IR FR Freq ----- these are headers
1 3 fgh 23 45 56 78
2 5 ty 56 67 67 67
Group Number Name Rate IR FR Freq ---- 2nd set of headers
4 3 ty 33 56 88 100
Hope that now i am bit clear
thanks a lot...
Pals
11-15-2010 10:17 PM
Hi pals,
I have modified your code a bit.Now you will get all the addresses where the word is present.Now you do not need worry about when to stop.
You need to change rest of the code. Take one address at a time and get data till you find blank space.Continue this procedure for the rest.
I hope this is the solution of your problem.
Best Of Luck
11-16-2010 02:52 AM
Hi Gaurav,
Thanks so much... Will try and let you know about it... Thanks once again....
pals
11-16-2010 05:50 AM - edited 11-16-2010 05:50 AM
Hi Gaurav,
Thanks so much for your suggestion. I have modified to read all the headers from excel-sheet plus all the data below those header. Thanks so much...
Just need one suggestion that it overrides all the data i mean i need 6 arrays to store these 6 column data.So what the option to get rid of that override of data...
Thanks once again...
pals
11-16-2010 06:09 AM
I could not open your code as I do not use Labview 2010.
But you are using while loop so if you want all data you can replace tunnel( of while loop) and select enable indexing.
It will give you 2D data. Each column for Each header.
I hope you know enable indexing concept.
11-16-2010 06:15 AM
Hi Gaurav,
Thanks a lot... Ya i know that... Will try and let you know... Thanks...
pals