Simplest method to get intel hex file into a string List ?

edited September 2017 in How To...

title says it really..... how to easily take each line of a hex file and make it a string in a StringList ?

Answers

  • Answer ✓

    loadStrings() will get you each line of the input file as a string array

    and there's a StringList constructor which takes an "Object ..." so you might be able to pass it in there.

  • Are you trying to load the raw ASCII lines, or are you trying to parse out the data contents of each line only, sans address, record type, checksum etc.?

  • edited September 2017

    https://en.wikipedia.org/wiki/Intel_HEX

    includes the following example

    :10010000214601360121470136007EFE09D2190140
    :100110002146017E17C20001FF5F16002148011928
    :10012000194E79234623965778239EDA3F01B2CAA7
    :100130003F0156702B5E712B722B732146013421C7
    :00000001FF
    

    (i must admit i thought the OP meant the output from something like xxd)

  • Thanks Guys, I'm re-writing a little bootloader application from delphi across to java/processing to make it crossplatform and hopefully easier to maintain. I only need the RAW ASCII lines into the array, so I can then fire them out the serial port to MCUs. loadStrings() into a string array seems to have done the job, no need for stringList, haven't done a test on actual MCU yet, but the data from the Hex file is coming in correct. Cheers, mala

Sign In or Register to comment.