Web Analytics Made Easy -
StatCounter Decoding binary data file and reading into (a) array(s) - CodingForum

Announcement

Collapse
No announcement yet.

Decoding binary data file and reading into (a) array(s)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Decoding binary data file and reading into (a) array(s)

    Hello.

    I need to be able to extract the data from the attached file (or any file in the same format) so that I can work with the data in PHP. I'm fairly comfortable with using PHP with databases, arrays, etc. but have not worked with binary data files.

    http://www.performancecentral.net/C...3Loop/3Loop.php

    click on "Download Performance".

    The good news is that I know at least most of the information the file contains b/c the program that created the file will export to a csv file (included at the bottom of this message).

    Please help. I tried to read using HHD hex editor, but failed to be able to make anything of it. I do know that the data is not encrypted, but it is obviously encoded somehow so I primarily need to figure out how to decode or have someone decode it for me. Please help.

    Thanks in advance. The csv file text follows:

    [USER DATA]
    Ray
    AGE=44
    WEIGHT=85.7 kg
    LOWER HR=60
    UPPER HR=221
    [END USER DATA]

    number of records = 913


    ms speed watts rpm hr ss lss rss lpwr rpwr miles wind grade load

    " 0"," 0.00"," 0"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0000"," 0"," 0.00"," 0"
    " 374"," 2.76"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0001"," 0"," 0.00"," 0"
    " 541"," 2.76"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0001"," 0"," 0.00"," 0"
    " 559"," 2.76"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0001"," 0"," 0.00"," 0"
    " 593"," 7.08"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0002"," 0"," 0.00"," 0"
    " 629"," 7.08"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0001"," 0"," 0.00"," 0"
    " 646"," 7.08"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0001"," 0"," 0.00"," 0"
    " 680"," 7.08"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0004"," 0"," 0.00"," 0"
    " 733"," 7.08"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0004"," 0"," 0.00"," 0"
    " 733"," 7.08"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0005"," 0"," 0.00"," 0"
    " 769"," 7.08"," 4"," 0","100"," 99"," 99"," 99"," 50"," 49"," 0.0005"," 0"," 0.00"," 0"

  • #2
    I'm not sure that I understand your problem.

    You state that you need to decode a binary file, however, you've presented us with a text file.

    Do you mean them to be the same thing? What is this encryption stuff you're talking about?

    If it's just a text file then you should look into some Perl tutorials for parsing a text file as it's basically the same as PHP.

    Please clarify what you're talking about for further assistance.

    Sadiq.

    Comment


    • #3
      By the way your link doesn't work... yu've actually got some dot dot dots in the middle...

      Sadiq.

      Comment


      • #4
        The binary file is located at:

        http://www.performancecentral.net/Co...Loop/3Loop.php

        Click on 'download performance'.

        The company whose SW creates the binary file also creates a program that will read the binary file and export a text file of data which you see above. What I need to be able to do is circumvent the process of using the SW to read and export the data from the binary file directly instead. This is b/c not all my users have the SW that creates the text file and also b/c it is inconvient and error prone to have to export the data vs just uploading the binary file. Thanks.

        Originally posted by sad69
        I'm not sure that I understand your problem.

        You state that you need to decode a binary file, however, you've presented us with a text file.

        Do you mean them to be the same thing? What is this encryption stuff you're talking about?

        If it's just a text file then you should look into some Perl tutorials for parsing a text file as it's basically the same as PHP.

        Please clarify what you're talking about for further assistance.

        Sadiq.

        Comment


        • #5
          Try the link in the response immediate above this. It should work even though the dots are still there. Thanks.

          Originally posted by sad69
          By the way your link doesn't work... yu've actually got some dot dot dots in the middle...

          Sadiq.

          Comment


          • #6
            When I click that link, I get a .zip file. Within the .zip file is a 3dp file -- I'm assuming this is the binary file you're talking about.

            So your question is how to convert that binary file to it's csv equivalent?

            Let me tell you, it beats the heck out of me!

            You'd have to see their software that generated that binary file. I don't know enough about binary files, but you could almost be asking how to get the source code from a .exe file.

            I really can't help you. Perhaps someone else on the board can be of more assistance. But if I were you, I would probably contact this company that wrote the software, explain your situation, and ask for their cooperation. You'd be surprised how willing some people are to help.

            Good luck!
            Sadiq.

            Comment


            • #7
              Thanks for your reply. Unfortunately the company is not willing to cooperate. Anyone else?

              Originally posted by sad69
              When I click that link, I get a .zip file. Within the .zip file is a 3dp file -- I'm assuming this is the binary file you're talking about.

              So your question is how to convert that binary file to it's csv equivalent?

              Let me tell you, it beats the heck out of me!

              You'd have to see their software that generated that binary file. I don't know enough about binary files, but you could almost be asking how to get the source code from a .exe file.

              I really can't help you. Perhaps someone else on the board can be of more assistance. But if I were you, I would probably contact this company that wrote the software, explain your situation, and ask for their cooperation. You'd be surprised how willing some people are to help.

              Good luck!
              Sadiq.

              Comment

              Working...
              X