10-04-2011 07:03 PM
Hi
I would like to read a csv file into a cluster of 4 elements
which would then be read into a 1-D array.
My cluster contains a typedef, a double, a boolean, and another typedef.
Basically it could be seen as:
Bob Runs, 4, T, Bob
Mary sits, 5, F, Mary
Bob Sits, 2, F, Bob
Mary Runs, 9, T, Mary
………………
Are there any good
examples for what I am trying to put together that I could leverage, or is it
better to use a different input file than a csv. I am trying to make my program more flexable
and easier to make adjustments even after the executable is created.
Thanks
Solved! Go to Solution.
10-05-2011 04:25 PM - edited 10-05-2011 04:31 PM
Did you mean to post this in Signal Express or the LabVIEW forum? You don't specifically state in your post which but it sound like you might be asking for help importing text into labview.
You can make a 1D cluster array in LabVIEW that will allow you to index each row and then you can unbundle each entry as you need.
10-05-2011 05:31 PM
Sorry, I must have selected the wrong forum by accident
10-06-2011 08:29 AM
No problem. I went ahead and sent a mod a post to move this to the correct forum.
Anyway, there is a subvi included with labview call "Read from Spreadsheet File.vi". You can find it in the Programming palette in the Fuctions window. You should be able to read your csv file with this and place it in a 2D array of strings. If you want certain types you'll have to do some more conversion. You could use a case statement to check if column 3 is T/F and then output a boolean value to insert into your array of clusters.
Read from Spreadsheet file Help
This should get you started. If you have any questions please feel free to ask.
10-06-2011 10:40 AM