LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

new line in text-files

Hallo,

this I have a problem with writing data in a text-file. How can tell LabVIEW (6.1) to begin a new line in the file?

I already tried the [carriage return] -- constant, building arrays, building spreadsheat strings from array etc.. Everything wit no success.

Can anybody of you help me?

Thanks a lot, Arno
0 Kudos
Message 1 of 7
(5,074 Views)
Send an End of line character to the file. You can find an End of line constant in the string pallette.
Message 2 of 7
(5,074 Views)
Thanks a lot, it works.
0 Kudos
Message 3 of 7
(5,074 Views)

Hi, what do you mean by send an end of line constant to the file? I have an end of line constant in the concatenation of a string that I then pass through to write to text file, and i keep overwriting the top line it seems

0 Kudos
Message 4 of 7
(349 Views)

@LShek wrote:

Hi, what do you mean by send an end of line constant to the file? I have an end of line constant in the concatenation of a string that I then pass through to write to text file, and i keep overwriting the top line it seems


 

You replied to a 20 year old thread with a slightly different problem.

 

Obviously, you are overwriting instead of appending, and that can have many possible reasons. Without seeing your vi, we cannot tell what you are doing wrong.

0 Kudos
Message 5 of 7
(339 Views)

When you open a file, the write (or read) pointer is initially located at the beginning. If you want to append data, you need to use the Set File Position function to move it to the end. Some vis (for example Write Delimited Spreadsheet) let you specify an Append flag so you don't need to do this explicitly.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 7
(320 Views)

@pincpanter wrote:

When you open a file, the write (or read) pointer is initially located at the beginning. If you want to append data, you need to use the Set File Position function to move it to the end. Some vis (for example Write Delimited Spreadsheet) let you specify an Append flag so you don't need to do this explicitly.


That's why I said that there are so many possibilities. The mentioned "Write to text file" is a low level primitive and if the file is kept open, the pointer will automatically be after the last write, i.e. appending. No need to set the file position unless the file is opened from scratch.

 

I intentionally did not list a litany of possible solutions until we can narrow it down to the actual scenario. :D.

0 Kudos
Message 7 of 7
(309 Views)