08-06-2012 01:54 PM
So I'm currently working on writing a separate 1d file and a 2d file and would like to write these values into an excel worksheet. I tried to use 2 'Write to Spreadsheet File' and was hoping that the first 'Write to Spreadsheet File' that was writing the 1d file would be erased the program wrote the second 'Write to Spreadsheet File' (writing the 2d file). Is there anyway I can do it the way I'm trying to do it now? Thanks.
Jon
08-06-2012 02:04 PM
Just realized that I didn't attach the image of the block diagram. Here is an image of what I am talking about.
08-06-2012 02:13 PM - edited 08-06-2012 02:14 PM
I'm not sure what you are trying to accomplish. The second write should overwrite the first one since "append to file?" defaults to false. So your 1D array is being overwritten as soon as it was saved to disk.
BTW, look into the Build Path instead of your convert to string, concatination, and convert to path in order to build the file's path. Just trying to save you a little effort.
08-06-2012 02:14 PM
I was hoping that the 1d file would NOT be erased when I wrote the 2nd 2d file into the 'Write to Spreadsheet File'. Unfortunately, this is what happened and I'd like to know if any of you know if there is a way I can save that first column (not get it erased) when i write the 2d file which would start at the 2nd columns. Sorry for the confusion. Anyone have any ideas? Thanks!
Jon
08-06-2012 02:15 PM
You would have to combine the arrays in order to do that.
08-06-2012 02:17 PM
adding it to the bottom is a piece of cake... just append.
TO add more coolumns you will have to read a line from the first, append to that line the additional data for that line ...
and continue till you have it all written.
There are other methods (read transpose add re-transpose) but none that are straight forward.
Ben
08-06-2012 02:23 PM - edited 08-06-2012 02:24 PM
Do you want your time and data points formated the same? You picture has both of them formated as "%.4f". It seems a little weird having integers formatted with 4 0s behind them. If you want as is, this should work for you.
08-06-2012 02:31 PM
@crossrulz wrote:
Do you want your time and data points formated the same? You picture has both of them formated as "%.4f". It seems a little weird having integers formatted with 4 0s behind them. If you want as is, this should work for you.
"what he said"
Ben
08-06-2012 02:50 PM
thanks for your help guys. I'll give some of your ideas a try.
@ Crossrulz - Thanks for the diagram. I did try your schematics but my labview apparently does not like it because it kept crashing my labview...
Thanks!