LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to clear contents of a file

Solved!
Go to solution

Hello,

 

I have a file which has some  characters written into it, I want to clear the file how can I do this?

 

Say I have word called "LabVIEW" , I need to clear this word and final result should be empty file.

 

or I need to replace the contents by writing "NI" into the file, but when I do this I still find other characters from LabVIEW word.

 

Thanks in advance

0 Kudos
Message 1 of 6
(4,387 Views)
0 Kudos
Message 2 of 6
(4,379 Views)

Thanks,

 

But it does not work for me,

 

I tried this yesterday lot of times but was unsuccesful so posted here,

, 17963i259F673EB9A6176A

0 Kudos
Message 3 of 6
(4,352 Views)
Solution
Accepted by topic author cancancanopen

There is a difference between your method and mine. My method will move the EOF marker so that it gets placed after whatever I've written to the file, which in this case is the empty string. With your method the EOF marker is not moved. To perform the equivalent operation with your code you'd have to use the Set File Size right after the write function to set the file size to be the length of the string you wrote to the file. Or, you can just use the single function as I did.

Message 4 of 6
(4,348 Views)

Well this settings work for deleting the contents.17965i376C2257A9C8645C

Closing this post

0 Kudos
Message 5 of 6
(4,345 Views)

Hello

 

Your post will definetely help me with all EOF, but I am not using EOF check etc etc, I will try what you said now, and penned down in my book,

 

Thanks,

0 Kudos
Message 6 of 6
(4,343 Views)