LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Write To Spreadsheet Append

Hello, I am using the "Write To Spreadsheet" vi to write data to a .csv file using the comma delimiter.  The append function within the "Write To Spreadsheet" vi always appends to the next row in my .csv file.  Is there a way to append to the file where the data left out from the previous write without appending to the next row?

 

For example I was to use the "Write To Spreadsheet" vi twice with the same file.  The first time I write I get:

 

Product  Test1  Test2  Test3

 

When i write Failure1 and Failure2 using the "Write To Spreadsheet" vi again my .csv file cells become (two rows):

 

Product   Test1    Test2    Test3

Failure1  Failure2

 

What I would like to see is this (one row):

 

Product   Test1   Test2   Test3   Failure1   Failure2

 

Is this possible to do with the "Write To Spreadsheet" vi?

 

Thank you.

0 Kudos
Message 1 of 5
(2,984 Views)

Not with the Write To Spreadsheet File.  You could make you own file format by using the Open/Create/Replace File and the Write Text File.  You will have to format your strings before you write to the file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(2,983 Views)

Crossrulz, are there any good examples using the Open/Create/Replace File method showing how to format strings before writing to the file using "Write Text File?"

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

You could actually just dig into the Write to Spreadsheet File and see how they did it.  Otherwise going into the LabVIEW example finder (Help->Find Examples) and do a search for Write Text File.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(2,960 Views)

You cannot append rows to a file without needing to rewrite the entire file at the end.

 

A file is just a linear long string of bytes with delimiters for fields and rows. If you want to add a column, virtually all existing data needs to be shifted around and the new column interlaced. You would need to read the entire existing file, manipulate the data, and rewrite the file from scratch.

 

(Only if you append rows, it can be done at the end of the file without touching the existing content.)

0 Kudos
Message 5 of 5
(2,951 Views)