Reading Binary File

How could one read the data contents of a specific byte of a binary file, for example data read out form an Eprom
spurs1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Erick37Commented:
Here is an example of reading one byte from a file:

Private Sub Command1_Click()
    Dim i As Long
    Dim fSize As Long
    Dim Data As Byte
    ' Open file in random-file mode.
    Open "c:\test.bmp" For Random As #1
    fSize = LOF(1) ' Gets file size.
    i = 100 ' get byte 100
    Seek #1, i   ' Set position.
    Get #1, , Data  ' Read byte.
    Close #1    ' Close file.
    Debug.Print Data
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Erick37Commented:
Make that Open "c:\test.bmp" For Binary As #1

Change to Binary for byte reads!!!
0
fmuftiCommented:
My friend posted this quiestion on my behalf so once I get the solution I'll ask him to award the points.
The problem is a binary file as three portions first the bytes( offset), data, ASCII. I want to read the data which is hex e.g at byte 20 if the velue is 6F, I want to read 6F as it is.
Now some one help me.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.