LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting Output

I have the following array:

83 84 85 86 87 88 89 90 91 92

I want to save it to file with two entries per line i.e


83 84
85 86
87 88
89 90
91 92


is there an easy way to do this in labview ?


THanks.
Intern NSWCCD Carderock.
0 Kudos
Message 1 of 4
(2,755 Views)
Yes, there is. The Reshape Array function will convert the 1D array to a 2D and then Write To Spreadsheet File will save it. Use Array Size to get the size of the 1D array and divide by two to get number of rows. Fix the number of coulmns at 2. For Write to Spreadsheet, specify a space as the delimiter.
0 Kudos
Message 2 of 4
(2,747 Views)
The attached VI will do what you need.

It uses the 'Reshape Array' function to transform the 1D array into a 2D array. You have to calculate the size of the row dimension by dividing the original array size by two. The column dimension will always be 2.

Ed

Somehow I missed that you wanted to save it as well, but Dennis took care of it 😉

Message Edited by Ed Dickens on 06-02-2005 10:20 AM



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 3 of 4
(2,747 Views)
Thanks a lot for the help!
Intern NSWCCD Carderock.
0 Kudos
Message 4 of 4
(2,739 Views)