LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW to Excel

Solved!
Go to solution

Hello Everyone, 

 

I am using simple LabVIEW 2018. for this.

I want to generate a report which is in the form of excel sheet.

I used Write delimited spreadsheet which is in File I/O. but whenever i run the program it is rewriting the data 

I want it to be append to the created file.

 

ex:

first it creates the files and write the data into it when I run again it should append the data to the same file.  

Download All
0 Kudos
Message 1 of 4
(147 Views)
Solution
Accepted by topic author Basavaraj093

This happened because you overwriting the file by creating the header.

Just check if this file already exists and write header for new file only:

Screenshot 2024-10-15 08.42.37.png

Message 2 of 4
(122 Views)

LabVIEW's "Write Delimited Spreadsheet" function, by default, writes a new file each time it is called.  There are 5 inputs on the left hand side, with File Path at the top (position 1) and Error In at the bottom (position 5).  Position 4 is "append to file?", with the default value being "new file:F".  If you don't wire "True" to this input, you will always overwrite.

 

To change its behavior so that it (almost always) appends, put this function inside a While Loop with "True" wired to the Stop condition (so it runs once and exits).  Put a Shift Register on the While and wire it to the "append to file?" input.  Do not initialize this Shift Register.  Instead, wire a True to the right-hand (output) side of the register.

 

Do you see what this does?  The first time you bring 1D or 2D data to this "enhanced" Write Delimited function, it uses the file path (or gives you a dialog if empty), and "append to file?" is false because the Shift Register was not initialized.  When it writes that first time and exits the While Loop, the Shift Register is set to "True", so all further writes will "append to file".

 

Bob Schor 

Message 3 of 4
(71 Views)

Thank for your reply, it works fine know.

 

0 Kudos
Message 4 of 4
(60 Views)