Append to a Text or Binary File in LabVIEW

Updated Jul 15, 2019

Reported In


  • LabVIEW

Issue Details

  • I am using the Open/Create/Replace File function to open a file. When I write to the file multiple times, the data stored in the file is being overwritten with new data on each write. How do I append data to the end of the file on each file write?
  • When I open a file then read the file first and then write to it, the new line will be appended. How do I do this without the read function?


Use the Set File Position function found on the Functions palette under Programming»File I/O»Advanced File Functions. This function allows you to set the cursor to either the start, the end or a user specified point in the file.
This function should be placed between the Open/Create/Replace function and the Write Text File function or Write Binary File functions using the same refnums.  
This works for both LabVIEW and LabVIEW NXG.


Additional Information

When a file is opened in LabVIEW the cursor is set to the first position in the file. When a Read Text File or Read Binary File function is used it scans the full file and subsequently moves the cursor through the file to the end and so when a write occurs after that it will do it from the end.