Finding a position in a binary file

  • Thread starter Thread starter kingnl
  • Start date Start date
K

kingnl

I am a new programmer and I have a file that I need to find the
position of a certain set of characters? Can anyone help me? I also
need to be able to split the file at that point and write each part to
a temp file. Any help would be appreciated.

Thanks

Nick
 
Hi Kingl,

When it is a textfile than it can be something as
Typed here watch typos.
\\\
dim a as integer = mytext.indexof("MyCertainCharacters")
dim mytextBegin as string = mytext.substring(0, a)
dim mytextEnd as string = mytext.substring(a)
///
That should be enough,

I hope this helps?

Cor
 
Sorry see now your subject "binary file" I was focused at characters.

The solution I gave you is not for a "binary file".
 
* (e-mail address removed) (kingnl) scripsit:
I am a new programmer and I have a file that I need to find the
position of a certain set of characters? Can anyone help me? I also
need to be able to split the file at that point and write each part to
a temp file. Any help would be appreciated.

Check out the 'System.IO.BinaryReader' and the 'BinaryWriter' classes.
 
Back
Top