06-14-2007 04:19 PM
06-15-2007 04:26 PM
Though Applications Engineers at National Instruments do not typically write customer code, today I felt like a challenge. I have attached a VI (ViewDataColumns.vi) that should accomplish exactly what you are trying to do.
Essentially, this application reads in your data as a 2D array (a sample file is attached as OldData.txt). After this point, the program loops for the number of columns that you would like to end up with (based on the number of rows / col). During each iteration of the loop, a chunk of the original data array is extracted and then inserted into an output array. When the program is finished running, you can view the output on the front panel.
If you wish to save the altered data to a text file, you can use the Write Spreadsheet File function located on the File I/O palette. I hope this helps!
Regards,
Casey Weltzin
Applications Engineer
National Instruments
06-15-2007 04:29 PM
06-15-2007 04:32 PM
06-15-2007 05:07 PM
06-15-2007 05:23 PM - edited 06-15-2007 05:23 PM

Message Edited by altenbach on 06-15-2007 03:29 PM
06-15-2007 05:29 PM
06-15-2007 05:43 PM - edited 06-15-2007 05:43 PM
@roiht wrote:
Though you forgot to place Number to string pallatte in between, but I've placed it now and it's working simply great.
Just for your reference:
Actually, this VI works correctly under LabVIEW 8.2, where the "read from spreadsheet file" got enhanced with a polymorphic selector that allows reading arrays of strings instead of arrays of numbers. The downconversion to LabVIEW 8.0 can only read numeric spreadsheets, breaking the code.
This is how it looks in 8.2:

(Whenever possible, I check downconverted code in the target version and correct such issues. Most likely, Caseyw does not have 8.0.)
If you want to adapt this code for 8.0, read it as a string, then convert to a 2D array of strings to simulate the 8.2 capabilities.
Still, I prefer my method. 😄
Message Edited by altenbach on 06-15-2007 03:46 PM
06-18-2007 10:09 AM
Thank you Altenbach! It is always great to learn some new LabVIEW tricks. In addition, thank you once again for your constant contribution to the LabVIEW forums; all of the Applications Engineers at National Instruments really appreciate it.
Regards,
Casey Weltzin
Applications Engineer
National Instruments