+ Reply to Thread
Results 1 to 3 of 3

Parsing Hexadecimal String (.hex File Format)

  1. #1
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question Parsing Hexadecimal String (.hex File Format)

    I am trying to parse a string which is made up of hexadecimal characters. I'm parsing using the Mid() function in Excel 2010. The string looks something like this from left to right: :10C010006C6C7920676F207468726F756768206137 . It is the .hex file format. Character 2 and 3 represent the length of data in hex. So in the example the 10 is really 16 decimal (0x10 = 16 decimal). Characters C010006 for me aren't important. Characters 6C 6C 79 20 67 6F 20 74 68 72 6F 75 67 68 20 61 (spaced placed to break up the data) are the characters I care about. Every 2 numbers represent a hexadecimal byte. In my example the first number in decimal = 16, so I need to place 16 pairs of data into 16 cells side-by-side and then place the last 2 character pair in the last cell on the right. Where it gets difficult, the first number can be any even number from 2 to 16 (2-32 characters). I would like to put the last two pairs in the last cell on the right. this last column will always have the last two numbers. If the first number is 08 then there will be 8 pairs starting in position 10 followed by a single pair. if the first number is 02, then starting in character 10 there will only be one data pair and 1 end of string pair. I would like to do this without VBA, but if that is not possible I will conform. I'm trying to create a parser which will check for mistakes or other problems which can be averted prior to releasing. any help would be great. Thanks.

    Tony

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Parsing Hexadecimal String (.hex File Format)

    Hi Tony,

    If you can give us a workbook with about 4 examples of what you start with and what you want to end up with, it makes our task a lot easier. It will also get you a much faster answer.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Parsing Hexadecimal String (.hex File Format)

    Hi,

    I think it would be like this :

    Your data at cell A1

    Formula at B1 :
    Please Login or Register  to view this content.
    copy this formula to the right
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Alphanumeric string conversion into hexadecimal then report the number of bytes
    By Talamon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2014, 03:38 PM
  2. [SOLVED] String parsing to get name of csv file
    By rmachbitz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2013, 02:20 PM
  3. string to hexadecimal?
    By Mark121 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2008, 10:26 AM
  4. Need help parsing a string
    By Daminc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2006, 07:53 AM
  5. parsing a string
    By Mark in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-28-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1