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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove bytes from binary file

Status
Not open for further replies.

impulse24

IS-IT--Management
Jul 13, 2001
167
0
0
US
I have some files where I need to always remove the first 192 bytes. Is there a way to do this in vb6. I know how to open the file in binary mode, but it is not text data or records, so there is no consistency, I just need to remove the bytes.
 
Could you perhaps read the entire file into a byte array and then simply rewrite it starting with the 193rd byte?
 
how do you read the file into a byte array. I have never done it before.
 
Use the Open statement in Binary mode.

Then you might be able to pop right over to 193 using Seek

Then you can do the read with Get and the write with Put

Dont forget to Close when you're done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top