LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read only specific index

Solved!
Go to solution

 

Hi,

I would like to use boolean array to select the columns of the index array to read from the read from spreadsheet file. As shown in the file mitdb (102).txt, I should read only column of index 4 and of index 7 (V2 and V5)!

Any help would be appreciated.

 

Thanks

Wasabi

 

Hi,
I would like to use boolean array to select the columns of the index array to read from the read from spreadsheet file. 
As shown in the file mitdb (102).txt, I should read only column of index 4 and of index 7 (V2 and V5)!
Any help would be appreciated.

Thanks

 

Hi,

 

Download All
0 Kudos
Message 1 of 7
(3,186 Views)

You should only have to do something like this. I am not sure what the code that generates the boolean array is doing but it should work this way.

 

17757iAD57B2F9D89E4C38

Tim
GHSP
0 Kudos
Message 2 of 7
(3,177 Views)

I don't understand the question. Your data file only has 3 columns. Where are you indexing out the 4th and 7th column? I can see that you're searching a string array for those keys, but I don't see how those index values relate to your data file. Also, why do you even need the Boolean array? All you need are the index values from the Search 1D Array function.

0 Kudos
Message 3 of 7
(3,169 Views)

 

This is only a piece of my program. I would like to read the column with V2 as if it is fourth column and 
the V5 as if it is seventh column like the order of boolean array, 
all this without adding the zeros in the other columns. So i want that only array 4 and array 7 are filled.
I read also from other files where I have all the 
8 columns and in that case I read all and i have no problem.
I don't know if I need the boolean array to do this, use it to check 
if there are all or some of the columns and then do some operations.
P.S. sorry for my bad english i hope you understand me!:-)

 


This is only a piece of my program. I would like to read the column with V2 as if it is fourth column and the V5 as if it is seventh column like the order of boolean array, all this without adding the zeros in the other columns(1,2,3,5,6,8). So i want that only array 4 and array 7 are filled.I read also from other files where I have all the 9 columns and in that case I read all and i have no problem.I don't know if I need the boolean array to do this, use it to check if there are all or some of the columns and then do some operations.

P.S. sorry for my bad english i hope you understand me!:-)

0 Kudos
Message 4 of 7
(3,155 Views)
Solution
Accepted by topic author wasabi22

So, if I understand correctly, you have a pre-allocated array of 9 columns, and you read a file. This file may contain anywhere from 1 to 9 columns, and the first line indicates which columns are in the file. You want to read the file and replace the specific columns in your Nx9 2D array. Is this correct? If so, then perhaps the following method is what you really want:

 

Download All
0 Kudos
Message 5 of 7
(3,144 Views)

 

This method is perfect for my problem! But i have another banal problem. I have pre-allocate a (File lenght)x9 2D array of zeros and then replace 
columns. so my final problem is in external For Loop because i should have an array where the number
of row is file lenght and no just a N=500 or other fixed value.

Thanks for your help!
This method is perfect for my problem! i have another little problem. I should pre-allocate a (File lenght)x9 2D array of zeros and then replace columns. so my final problem is in external For Loop because i should make an array 2D of zeros where the number of row is file lenght and no just a N=500 or other fixed value.

 

Best regards

 

Wasabi

 

0 Kudos
Message 6 of 7
(3,128 Views)

That information can be acquired from the 2D array that is returned by the file read:

 

 

Download All
Message 7 of 7
(3,109 Views)