Steve Holloway
Steve Holloway

Reputation: 71

How to clear the contents of a csv file from VB

I need to delete/clear all data from an existing csv file from Visual Basic. This seems really simple but I have had a lot of problems making it happen!

Upvotes: 0

Views: 1387

Answers (1)

sleske
sleske

Reputation: 83577

What do you mean by "clear all data"? The easiest option would be to delete the file.

If you want to replace it with an emtpy file, open the file for output, then close it. That should truncate the file.

Upvotes: 1

Related Questions