Reading text file as Binary

skiphooper

Registered User.
Local time
Today, 04:30
Joined
Nov 29, 2000
Messages
76
Hi Everyone,

I have the need to read a text file as
binary. It's really a fixed length file,
but because of the specs I can't use
Input # or Line Input # .
Each dept puts the file out according
to their own specs. ( I assume it's got
something stupid to do with politics )

Anyway, I can read the fields they want in
the first record, but my question is : How do
I read all the records in the file?

Part of the specs is that the users supply
me with the starting position, and length
of each field needed, also there are some
fields that are not in the record, and they
supply constants for those fields.

With the Get #FileNum, 1, MyString
( 1 being the record position to start
reading from, and MyString defining the
number of positions to read. )

How do I read all the records.

Thanks In Advance.

Skip

[This message has been edited by skiphooper (edited 02-28-2001).]

[This message has been edited by skiphooper (edited 03-01-2001).]

[This message has been edited by skiphooper (edited 03-01-2001).]
 
You read the entrie record, its just a string of bytes, then you have to unpack it, byte by byte, convert each buyte to an ascii character, keeping logical groups of characters, then convert the logical groups to the correct data type. There's a lot of brute force in programming isn't there!
 
Hi llkhoutx,

Looks like I have my work cut out for me.

Thanks for the reply.

Skip
 

Users who are viewing this thread

Back
Top Bottom