HexFile 
Author Message
 HexFile

    Not sure if this is the right group, but it's worth a shot.  Here's the
problem, I have a file that is used as record storage ( I didn't design it)
and the dollar values are stored as hex bits.  Now, when the file is opened
using FreeFile, I get the Text char.  For instance, if the bit value is 55,
I get U in the file.  So, my question is how do I read the hexbit value?
The delimeters in the file are also hex value, 00 bb, which returns a funky
text char.  I need to find how to parse this file, and so far the only way
is with Hex Workshop, but, since there's 1000's of files, this is
inpractical.  The end result?  Taking all these files and trying to convert
them so I can extract all the info and import them into my new SQL DB (which
I did design).

Thank you
Jody W



Wed, 09 Mar 2005 06:17:18 GMT  
 HexFile
To convert that "U" to a number, use Asc("U")... which gives you 85
decimal... Hex$(85) gives you your 55 hex... any help?

--
Ken Halter - MS-MVP-VB - Please keep it in the groups..
http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
New Tabbed Dialog http://www.vbsight.com/TBGDialogCTL.htm



Quote:
>     Not sure if this is the right group, but it's worth a shot.
> Here's the problem, I have a file that is used as record storage ( I
> didn't design it) and the dollar values are stored as hex bits.  Now,
> when the file is opened using FreeFile, I get the Text char.  For
> instance, if the bit value is 55, I get U in the file.  So, my
> question is how do I read the hexbit value? The delimeters in the
> file are also hex value, 00 bb, which returns a funky text char.  I
> need to find how to parse this file, and so far the only way is with
> Hex Workshop, but, since there's 1000's of files, this is
> inpractical.  The end result?  Taking all these files and trying to
> convert them so I can extract all the info and import them into my
> new SQL DB (which I did design).

> Thank you
> Jody W



Wed, 09 Mar 2005 06:22:57 GMT  
 HexFile
possibly, gonna have to try it with 25 which is %  It's a start, thanks....


Quote:
> To convert that "U" to a number, use Asc("U")... which gives you 85
> decimal... Hex$(85) gives you your 55 hex... any help?

> --
> Ken Halter - MS-MVP-VB - Please keep it in the groups..
> http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
> New Tabbed Dialog http://www.vbsight.com/TBGDialogCTL.htm



> >     Not sure if this is the right group, but it's worth a shot.
> > Here's the problem, I have a file that is used as record storage ( I
> > didn't design it) and the dollar values are stored as hex bits.  Now,
> > when the file is opened using FreeFile, I get the Text char.  For
> > instance, if the bit value is 55, I get U in the file.  So, my
> > question is how do I read the hexbit value? The delimeters in the
> > file are also hex value, 00 bb, which returns a funky text char.  I
> > need to find how to parse this file, and so far the only way is with
> > Hex Workshop, but, since there's 1000's of files, this is
> > inpractical.  The end result?  Taking all these files and trying to
> > convert them so I can extract all the info and import them into my
> > new SQL DB (which I did design).

> > Thank you
> > Jody W



Wed, 09 Mar 2005 11:22:33 GMT  
 HexFile
okay, that does work, thank you.


Quote:
> possibly, gonna have to try it with 25 which is %  It's a start,
thanks....



> > To convert that "U" to a number, use Asc("U")... which gives you 85
> > decimal... Hex$(85) gives you your 55 hex... any help?

> > --
> > Ken Halter - MS-MVP-VB - Please keep it in the groups..
> > http://www.vbsight.com - http://www.vbsight.com/MultiColumn.htm
> > New Tabbed Dialog http://www.vbsight.com/TBGDialogCTL.htm



> > >     Not sure if this is the right group, but it's worth a shot.
> > > Here's the problem, I have a file that is used as record storage ( I
> > > didn't design it) and the dollar values are stored as hex bits.  Now,
> > > when the file is opened using FreeFile, I get the Text char.  For
> > > instance, if the bit value is 55, I get U in the file.  So, my
> > > question is how do I read the hexbit value? The delimeters in the
> > > file are also hex value, 00 bb, which returns a funky text char.  I
> > > need to find how to parse this file, and so far the only way is with
> > > Hex Workshop, but, since there's 1000's of files, this is
> > > inpractical.  The end result?  Taking all these files and trying to
> > > convert them so I can extract all the info and import them into my
> > > new SQL DB (which I did design).

> > > Thank you
> > > Jody W



Wed, 09 Mar 2005 11:31:59 GMT  
 HexFile
Okay, all that works, but, I'm having another problem with this.  I need to
reference position within the file using the hex offset.  Is there anyway of
doing this?  Thanks again


Quote:
>     Not sure if this is the right group, but it's worth a shot.  Here's
the
> problem, I have a file that is used as record storage ( I didn't design
it)
> and the dollar values are stored as hex bits.  Now, when the file is
opened
> using FreeFile, I get the Text char.  For instance, if the bit value is
55,
> I get U in the file.  So, my question is how do I read the hexbit value?
> The delimeters in the file are also hex value, 00 bb, which returns a
funky
> text char.  I need to find how to parse this file, and so far the only way
> is with Hex Workshop, but, since there's 1000's of files, this is
> inpractical.  The end result?  Taking all these files and trying to
convert
> them so I can extract all the info and import them into my new SQL DB
(which
> I did design).

> Thank you
> Jody W



Wed, 09 Mar 2005 22:26:20 GMT  
 HexFile


Quote:
> Okay, all that works, but, I'm having another problem with this.  I
> need to reference position within the file using the hex offset.  Is
> there anyway of doing this?  Thanks again

The Seek statement lets you position where you want in the file; note that
it starts at 1

BTW, rather than reading strings and using ASC to convert to hex I'd suggest
opening the file for Binary and using the Get and Put statements to
read/write Byte variables or Byte arrays.  By reading strings you get
ansi/unicode conversions going on and that could potentially affect your
results.



Wed, 09 Mar 2005 22:36:10 GMT  
 HexFile
Not sure if that would work, but worht a try.  The file file format is
goofy.  All the records are index via Hex offset, and everything's ASCII
except the dollar amount, which is a 5 position hex value.  like 55.25 is U
% in the file.  Will try your suggestion and hopefully that is the missing
key I've been searching for.
Thanks

Quote:


> > Okay, all that works, but, I'm having another problem with this.  I
> > need to reference position within the file using the hex offset.  Is
> > there anyway of doing this?  Thanks again

> The Seek statement lets you position where you want in the file; note that
> it starts at 1

> BTW, rather than reading strings and using ASC to convert to hex I'd
suggest
> opening the file for Binary and using the Get and Put statements to
> read/write Byte variables or Byte arrays.  By reading strings you get
> ansi/unicode conversions going on and that could potentially affect your
> results.



Fri, 11 Mar 2005 02:50:29 GMT  
 HexFile


Quote:
> Not sure if that would work, but worht a try.  The file file format is
> goofy.  All the records are index via Hex offset,

an offset is an offset.  It can be represented in Hex, decimal, binary or
any other format you like.  It's just a number.

Quote:
> and everything's
> ASCII except the dollar amount, which is a 5 position hex value.
> like 55.25 is U % in the file.  Will try your suggestion and
> hopefully that is the missing key I've been searching for.

you can potentially read the ascii parts into a string using Get and then
the U% into bytes.


Fri, 11 Mar 2005 05:21:19 GMT  
 
 [ 8 post ] 

 Relevant Pages 
 

 
Powered by phpBB® Forum Software