LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combine two arrays to string and save to file

Solved!
Go to solution

Hi,

 

I'm trying to save a 2D array of data together with time stamp of an event to .txt file. I've formatted each array (the 2D array and the time stamp array to strings) and then I write it to file. The result of the combination is wrong though, the time stamp array should be in a column of its own instead of at the bottom of the file. How can I fix this?

 

Thank you,

 

 

Download All
0 Kudos
Message 1 of 5
(3,524 Views)

Where do you want the timestamps? One of them at the bottom of each column?

Did you try to wire the 1D timestamp array (without build array and transpose) to the array to spreadsheet string function? Then you should get a string with all timestamps on one line.

Also, leave away the \t in the format to file.

 

0 Kudos
Message 2 of 5
(3,507 Views)

Hi Dan,

 

I'd like to have the time stamp column as the 7th column on the spreadsheet. Non of the things I've tried worked.

0 Kudos
Message 3 of 5
(3,496 Views)
Solution
Accepted by topic author simply_me

Then I would suggest to convert the 2D data array into a 2D string array (using the desired number to string function). Then append the timestamp column (in string format as well) to the 2D array. Then use the array to spreadsheet string on the 2D string array.

 

0 Kudos
Message 4 of 5
(3,490 Views)

Hi Dan,

 

Thanks for your help. I've messed around it for hours and, now, it's working.

I've used "Number To Engineering String Function" because that's the only one that works with dbl....

 

0 Kudos
Message 5 of 5
(3,484 Views)