How to parse text file

What is best way to parse this text file ?
I would like to read the contents of the C code array.

#define index_html_gz_len 12
const uint8_t index_html_gz[] PROGMEM = {

The title says “text file” but here I see a binary array.
Do I miss something?

This is text file, C code listing.
I want to pass this file as argument to my program in GO and read the contents of the C array to byte array in golang.

I’d say the *best* way to do this would be to find a C parser and parse what you’re looking for. That, however, might be overkill for what you need.

Given just the requirement to parse the content of this C array, I would just use some regular expressions to “parse” the data that you’re looking for:

1 Like

Thank you very much, that’s exactly what I need. :smiley:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.