10-24-2012 10:26 PM
Hi all,
I have two arrays:
1 2 3 5 6
2 5 4 and 7 8
5 6 4
and I want to save the two arrays in a txt fil with the 'Write to Spreadsheet File' function to get:
1 2 3 5 6
2 5 4 7 8
5 6 4
in the attached file, I tried something but it is not what I want because it put the second array at the bottom of the first array.
any suggestions?
thank you
Cedric
Solved! Go to Solution.
10-24-2012 11:09 PM
10-25-2012 09:17 AM
Hi apok,
If the array are switched, it doesn't work. for example, when the first array is:
5 6
7 8
and the second array is:
1 2 3
2 5 4
5 6 4
the result is :
5 6 1 2 3
7 8 2 5 4
instead of:
5 6 1 2 3
7 8 2 5 4
5 6 4
is there a general strategy to do that?
thank you.
Cedric
10-25-2012 09:34 AM
Try Transpose Array on each input array then wire those arrays into Build Array (Concatenate Inputs) then Transpose Array again.
10-25-2012 09:48 AM
Cedric51,
In LV all arrays must be rectangular. All the rows in an array will be of the same length. Similarly all columns are equal in size to each other.
So when combining arrays of different sizes, you must be careful to define exactly what you want in the empty locations. Also many of the array functions truncate to the size of the shorter input arrray. Read the help files carefully and do some testing to see what you need to do to create the results you want.
Also note that all OSes supported by LV write files by rows, so that appending columns or inserting columns is difficult because much of the existing file needs to be moved. Sometimes it is easier to append rows until all the data is saved, then read in the entire file, tranpose, and write to the final file.
Lynn