取消
显示结果 
搜索替代 
您的意思是: 

Write to spreadsheet file append

已解决!
转到解答

Same problem as this guy here:http://forums.ni.com/t5/LabVIEW/write-to-excel-spreadsheet-in-columns-and-append-to-file-in-a/m-p/10...

 

I'm in labview 7.1.  I am reading in data, and want to append on new columns, whereas the excel spreadsheet function simply appends it onto the bottom of the file. 

 

Is there an easier way to do this, or should I write a VI that reads in a current spreadsheet file, then appends the data to the array as said in that link?

 

Thanks

0 项奖励
1 条消息(共 17 条)
10,394 次查看

I also don't see how appending the array would help either, since i will need to have this file have 5 columns, and "Write to Spreadsheet.vi" only supports 2d arrays.

0 项奖励
2 条消息(共 17 条)
10,386 次查看

There is no 'Excel Spreadsheet function' unless you are using ActiveX. The Write to Spreadsheet function simply writes a text file and unless you want to switch to using ActiveX and an actual Excel document, then the only way to add columns is by reading in the old file, append the new columns to the array, and write the new.

 

Don't understand your last comment. No matter how many columns you have, it's still a 2D array. How many dimensions did you think you had when you wrote 3 columns?

0 项奖励
3 条消息(共 17 条)
10,371 次查看

 


@Dennis Knutson wrote:

There is no 'Excel Spreadsheet function' unless you are using ActiveX. The Write to Spreadsheet function simply writes a text file and unless you want to switch to using ActiveX and an actual Excel document, then the only way to add columns is by reading in the old file, append the new columns to the array, and write the new.

 

Don't understand your last comment. No matter how many columns you have, it's still a 2D array. How many dimensions did you think you had when you wrote 3 columns?


 

Yeah, I know I'm outputting a text file. 

 

Ah, I gotcha, sorry, new to this. I see now that 3 (or 10 as I'll need) columns is a 2d array, thanks.

0 项奖励
4 条消息(共 17 条)
10,357 次查看
解答
接受人 bobholmgren

If you want to append columns, you would have to read in the spreadsheet data and use Insert Into Array to append to columns.  Just specify column index instead of row index.  Or you could transpose the array, Insert Into Array using row index, then transpose again.  Then write it all back.

 

- tbob

Inventor of the WORM Global
5 条消息(共 17 条)
10,349 次查看

 


@tbob wrote:

If you want to append columns, you would have to read in the spreadsheet data and use Insert Into Array to append to columns.  Just specify column index instead of row index.  Or you could transpose the array, Insert Into Array using row index, then transpose again.  Then write it all back.

 


 

That's what I'm working on now, thanks 🙂

Good to know I'm on the right track

0 项奖励
6 条消息(共 17 条)
10,346 次查看

Its more complex than I thought, all the transposing is throwing me off. Along with the fact that Read from Spreadsheet.vi only handles numbers (so my column labels are not happy, keep getting replaced by 0's).

0 项奖励
7 条消息(共 17 条)
10,340 次查看

Use the polymorphic selector under the Read From Spreadsheet vi to select String and it will read everything as strings.  Then your labels will remain intact.

 

- tbob

Inventor of the WORM Global
8 条消息(共 17 条)
10,334 次查看

Read From Spreadsheet does not only handle numbers. See the little box under the function (yours says 'Double')? Click on the arrow and change the type. You can also right click on it and do a 'Select Type'.

 

This is what is called a polymorphic VI. There are numerous polymorphic functions in LabVIEW.

9 条消息(共 17 条)
10,333 次查看

 


@tbob wrote:

Use the polymorphic selector under the Read From Spreadsheet vi to select String and it will read everything as strings.  Then your labels will remain intact.

 


 

 


@Dennis Knutson wrote:

Read From Spreadsheet does not only handle numbers. See the little box under the function (yours says 'Double')? Click on the arrow and change the type. You can also right click on it and do a 'Select Type'.

 

This is what is called a polymorphic VI. There are numerous polymorphic functions in LabVIEW.


 

Thanks!

0 项奖励
10 条消息(共 17 条)
10,324 次查看