Only asking questions to help you find answers ....
What are the contents of these binariy files? Are all of the bytes valid ASCII chars? Probably not, otherwise they would be TEXT files? So, How do you know what the bytes represent (and WHAT DO they represent?). It is probably a set of the old MKx values from pre-historic computation time, but you NEED TO KNOW before proceeding!! Next, there needs to be a 'layout', to tell you which bytes go to what number (assuming that I am correct in the assumption that they represent values).
A sample of the binary file along with the layout would be helpful.
After some of these answers, someone might be able to at least get you started. [sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
Hi Michael,
The file is telephone call data from a switch, which is in binary format. I have to convert it to ascii format to load the call data into a database.
I will at the outset have several different file layouts - ie what each record holds - and should be able to decide from information in the file which layout to use.
My problem still remains, how do i convert the binary to ascii?? Is it just a case of 2 to the power zero*right char in byte + 2 to the power 1* next char + 2 to the power 2*next char + ... or is there more to it than this??
I have never seen a 'binary' file before, which is the cause of my uncertainty.
You are looking for a funcionality that isn't supported by Visual Basic. Qbasic allows the use of the CVI, CVS, CVL and CVD functions which convert (respectively) 2-byte strings to integer numbers, 4-byte strings to single precision, 4 bytes to long integer and 8 bytes to double precision numbers.
The same functionality is probably supported by C and practically every other programming language in the world aside from Visual Basic.
You will twist your brain into a tight knot trying to figure out a way to convert these numbers using straight VB. Unless there are API calls designed to perform the transformations (if there are, I am not aware of them and a bit busy to research the subject) you might consider using a different language.
Sorry I couldn't be more helpful.
[sig]<p> <br><a href=mailto: > </a><br><a href=
I DO know how to convert the binary values (string representaion of numeic values, A.K.A. MKI/CVI ...). However, there are other issues as I noted before.
You must know the original file layout to use these conversions! They require the proper inputs to work, and can return 'wrong' results if you send incorrect inputs. The routines are quite simple, and have virtually NO ERROR checking. Partly, this is because there is very little which can be checked and partly because I only use them in an environment which does the (minimal)error checking before callling them.
If you send me at least a sample of the input w/ the file layout (and hopefully a desired NEW file(s) schema, I will check the functions produce at least a sample for your tables. If that works, I will send the routines and the sample code to convert the text fiel to the 'correct' values to you.
An easy (for ME) way to send this info would be for you to make the MS ACCESS tables and include a module which shows the text file layout (use the Field names of the MS ACCESS tables/Fields) in a module as declarations. If you are not able to do this, let me know and we could discuss alternatives.
[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
hi there michaelred
u can help me out
i have a set of binary data....
i have extracted the strings and integers using VB...
my real problem is that the originally implemented using Qbasic...and i do not know the data types used...
the file format is
string1-10bytes
string2-20bytes
string3-1byte
string4-2bytes
real1-4bytes
integer1-2bytes
real2-4bytes
rest of the fields are strings...
my problem is only with real1 and real2...
what data type it is i cannot figure out
if somebody can tell me this...i will be really indebted to them...
pleaaaaaaaaaaassssssseeeeee help me
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.