473,382 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Finding a position in a binary file

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
Nov 20 '05 #1
3 1290
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
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

Nov 20 '05 #2
Sorry see now your subject "binary file" I was focused at characters.

The solution I gave you is not for a "binary file".
Nov 20 '05 #3
* ki****@jaynet.wcmo.edu (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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Cengiz Ulku | last post by:
Hi, I've already posted a question similar but will need some precisions and help. I have a rtf file displayed within a RTB control. Above it, I have a text box control with a scroller which...
8
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi...
13
by: yaipa | last post by:
What would be the common sense way of finding a binary pattern in a ..bin file, say some 200 bytes, and replacing it with an updated pattern of the same length at the same offset? Also, the...
5
by: Robert Manea | last post by:
Hello everyone, I wrote, simply as an exercise, a small piece of code to find 'strings' (defined as an amount of at least 3 ASCII characters followed by a non ASCII character) in binary files. ...
6
by: Tarun | last post by:
Hi All, I need to find a particular substring in a binary string(some text appended & prepended to binary data). I cant use strstr since it terminates on receiving '\0'which can be there in...
2
by: Keith Kingsley | last post by:
I'm using a StreamReader to read in several lines from an ASCII file. I'd like to know the StreamReader's "true" position-- that is, the number of bytes into the file that the StreamReader has...
4
by: spivee | last post by:
I'm having an odd type of issue. I want to be able to pass an element name in my javascript event and find the location of the element, be it a div, span, img whatever, specifically the top and...
14
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given...
30
by: mmgarvey | last post by:
Hi, I'm using python to develop some proof-of-concept code for a cryptographic application. My code makes extended use of python's native bignum capabilities. In many cryptographic...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.