Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to delete certain file information

Status
Not open for further replies.

ryan

Programmer
Nov 13, 2000
73
US
I need to find in VB to manipulate a file to do the following. Say I had a file with the following contents:

1
2
3
4
5
6
7
8

Now I want to open that file and delete, starting from the number 4 to the number 6 and the result of the file should look like:

1
2
3
7
8

How can I do this via the FileSystemObject. There is no pointer of any kind so I'm having a hard time.

Thanks,
Ryan
 
yes, you can do it via filesystemobject. the help for that can be found at msdn.microsoft.com..

what you'd generally do is open the file for read, open a tempfile for output and write only the stuff from the source that you want to keep.
then delete (or backup) the sourcefile, replacing tempfile for source-file.
 
Other help should be available on your local machine, in a file called vbscript.chm

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top