03-13-2008 05:50 PM
03-13-2008 06:28 PM - edited 03-13-2008 06:29 PM
If you explained exactly what you've tried and how it doesn't work, you would get a more specif answer but shown below is a simple method to append columns to an existing array. It uses some basic elements in LabVIEW such as the Build Array function and a shift register. Use the Attachment field below the message body to attach your code.
03-14-2008 08:02 AM
Dennis,
thanks for the response. So, here is what I am trying to do, I have a number of very large
.csv files, that contain 75 variable names as column headers and 170,000 double data
type values for each variable.Overall, I am trying to create a customized file from that .csv
file that has only a user's selected variables and its values. Now, I am able to get whatever
variable I want and its values. The problem I am having is that when trying to store that data
to an array so that I can write it to a file the current overwrites the existing. I have tried writing
directly to the file with write to text file, write to spreadsheet, and others nothing works. I have
tried feeding the current back throught the loop with the feedback node and shift register. I have
tried to initialize an array and replace contents, I get the same result. I will add a couple of code
iterations to this post I hope someone can help me out. I thought it would be more intuitive to
to accomplish, I never thought it would this difficult. Thanks
03-14-2008 08:13 AM
Dennis,
Would like to add the lastest rev for you and others to look at.
Thanks again.
03-14-2008 09:00 AM
I'm sure Dennis will have a lot more comments, but this is the first thing I saw.
In this structure (and the way you have it set up, you could merge the sequence frames and merge the case structures) you are creating an empty, huge array. Then you insert something into the first column. show that in the output array indicator. Then you delete the first column and feed that to the shift register. In the end, you are left with what you started, a large empty array that just happens to flicker a column on an indicator.
In general, I would say there are 3 ways to work with arrays.
1. Initialize an empty array and replace elements as needed. (Most memory efficient. But you will have to worry about if you need to expand your array or contract it in the event you can't anticipate how large the array will need to be.)
2. Start with nothing and build the array piece by piece. (Not as memory efficient, but is commonly used in cases where memory efficiency is not critical.)
3. Start with some kind of array and insert and delete from it. (Not used very often. This would be similar to have an existing database and you need to manipulate the data such as adding or subtracting rows.)
You've basically managed to mix and match from all 3 of these scenarios in your code.![]()
03-14-2008 09:14 AM
Raven,
Thanks for the help. I noticed the first problem you mentioned seconds before
I read your email. So, I am glad to hear that I have made a correct change. Is
there anything-else you see that maybe causing trouble. I have been dealing
with this thing so long I could use a fresh pair of eyes, I missing obvious stuff.
Would initializing an empty array at the beginning resolve the issue or is there
more ahead. Thanks, man.
03-14-2008 10:16 AM - edited 03-14-2008 10:22 AM