Jump to content
Sign in to follow this  
obrienj

File with fields of 1 byte binary len followed by "len" bytes of displayable data

Recommended Posts

obrienj

I am drawing a blank as to how to process the subject file in AutoIt.

I know how to do it in C but I don't have a compiler available right now.

I have a file that is made up of variable length elements that have a single byte binary length followed by that length of displayable characters.

For example: 0x053132333435024142 which should yield "12345" and "AB"

I need to "walk the file" extracting all of the individual displayable data.

Any one have an example of how to do this?

I am getting all wound up with reading the file in binary, BinaryToString .....

Regards,

Jim

Edited by obrienj

Share this post


Link to post
Share on other sites
PsaltyDS

Read the whole file with FileOpen() in binary mode, and then use BinaryMid(), see help file.

Even better open the file in binary mode, the FileRead() in a loop getting one byte, then $iLen bytes, then one byte, etc.

:)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×