LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to delete or overwrite .csv file

hi...
i need some help here..can anyone teach me how to delete or overwrite an existing .csv file.?..in my .csv file there will be two columns which is column 1( 8 length) and 2 column ( 4 length).

please...i need the answer asap..really appreacite your help..thanks...
0 Kudos
Message 1 of 4
(4,131 Views)
Well, deleting or overwriting a file should not depend on the size of the columns. You just overwrite the file with the new data. What have you tried so far?
 
If you want to overwrite individual data points, you would read the file, modify the data in memory, and overwrite the file with the changed data. Overwiting individual values directly is only recommended for binary files unless you can guarantee that each value occupies a fixed number of characters and the offset can be calculated from first principles. 🙂
0 Kudos
Message 2 of 4
(4,130 Views)
hi..
Currently i using the write to spreadsheet file.vi to save all my data in the .csv file. and I have to enable the append to file terminal because i need to append the file until at certain time. Let say, i will stored all the data until 8.00 pm. Then after that time, i have to delete all the data inside that file.
I have try to disable the append to file terminal, and all the old data will be overwrite with the new one. but for my application, i have to enable that terminal. so i wonder if there is a way for me to delete the file or overwrite the whole data with the new data...

thanks..
0 Kudos
Message 3 of 4
(4,111 Views)
So read the time ("Get Time/Date String"), and if it is 8.00 pm just delete the old file  (use "write to spreadsheet file.vi" with append to file, set to false, or delete the file (see File I/O... Adv File Functions... Delete File)
0 Kudos
Message 4 of 4
(4,108 Views)