|
-
Jul 14th, 2005, 05:09 AM
#1
Thread Starter
Lively Member
[RESOLVED] How to delete text file!
I have a sequential file and I would like to edit it. I will do this by reading it all into an array, edit it, and write it all back. When I do that, the new edited text writes perfectly... but it doesn't remove the OLD text!!!!
How can I remove ALL the text inside the text file and re write it?
thankyou
You should LEARN not COPY... by learning you could be original in future work ... by copying you will risk getting in trouble.
And as always.... What goes around .. Comes Around.
-
Jul 14th, 2005, 05:36 AM
#2
Re: How to delete text file!
You seem to be appending instead of overwriting. Check your settings for opening the file in your writing method.
I don't live here any more.
-
Jul 14th, 2005, 06:13 AM
#3
Thread Starter
Lively Member
Re: How to delete text file!
hmm I would like to code to delete the ALL the text inside the file and over write it.
exmaple
streamwriter.clear()
or somthing like that
You should LEARN not COPY... by learning you could be original in future work ... by copying you will risk getting in trouble.
And as always.... What goes around .. Comes Around.
-
Jul 14th, 2005, 06:27 AM
#4
Re: How to delete text file!
Like wossname suggested:
VB Code:
Dim sw As New StreamWriter("<file path here>", False)
The second argument is True to append or False to overwrite.
-
Jul 14th, 2005, 07:29 AM
#5
Thread Starter
Lively Member
Re: How to delete text file!
OHHHHH so that what TRUE means!! thanks dude!!!!
You should LEARN not COPY... by learning you could be original in future work ... by copying you will risk getting in trouble.
And as always.... What goes around .. Comes Around.
-
Jul 14th, 2005, 10:02 AM
#6
Re: [RESOLVED] How to delete text file!
May I recommend never using any function without first fully understanding what the arguments are, mean and do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|