05-21-2012 07:46 AM
Hello all, I was wondering if there was a way to select only a certain "box" of elements from a .csv file in LabVIEW? I have LabVIEW 2011 and my main goal is to take two arrays and graph them against each other. I can import the .csv file just fine and separate each row and each column to be its own, but say I have an 8X8 but want to graph the middle 4X5 or something like that. Is there any way to extract an array without starting at the beginning and without ending at the end? Thank you in advance.
Solved! Go to Solution.
05-21-2012 07:51 AM
Hi Szklanam,
as a CSV file is just a TXT file with a different suffix you can read a certain number of lines of that file. So you can limit the number of rows in your resultung array. To limit the number of columns you still have to use ArraySubset, so maybe it's a lot easier to read the full CSV file and pick the interesting spots with ArraySubset...
05-21-2012 07:52 AM
Yes. You have the "Array subset" primitive that can extract a part of an array and doesn't necessarily start from the beginning.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-21-2012 07:52 AM
If you're asking about reading a specific chunk from the file, then you'd need to have a file that is fixed-format, so you'd know exactly at which byte to start reading, and how many bytes to read. Most CSV files are not.
05-21-2012 07:55 AM
3 similar answers in the same minute!
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-21-2012 08:12 AM
I will try this and see how it works out. Thank you
05-21-2012 08:38 AM
Yes this is exactly what I had been looking for. All the tutorials I had tried to look up online mentioned nothing about this. It was all about starting at the first element and it was really getting on my nerves. Thank you all, much appreciated.
05-22-2012 09:48 AM
Hi Szklanam,
If this issue has been solved, would you mind marking the solution? This helps because it lets other people looking for answers know that the solution to the thread has been found without having to read through the posts. Thanks!
05-22-2012 12:50 PM - edited 05-22-2012 12:51 PM
Three equivalent answers, one solution choice... WHO will get the glory???
EDIT: Wow, that was quick. Congrats GerdW! Don't spend it all in one place.