There’s some clever stuff here, and I’ve been testing @Kem Tekinay’s very efficient routines on binary files, here :
I am trying to adapt them in order to extract an embedded png file buried in the midst of a text file. The png header and end markers contain unprintable characters (return and end of line) along with others (above ASCII 128) that seem to thow the routines completely ! Is it possible to do this at all I wonder ?
The png header in HEX is 89 50 4E 47 OD OA 1A OA (âPNG are the only visinle characters) and the end marker is 49 45 4E 44 AE 42 60 82 (which are actually all visible - IENDÆB`Ç). My idea was to find the header and start saving the code into another string until hitting the footer, but I can’t even recognise either the header or end marker with Kem’s routines. Is there maybe a way to search in pure HEX or something ? I’ve searched for a good while (a few days now actualy !) and not had any joy. I thought RegExMatch should work, but it doesn’t. I also looked at SED and AWK and things like that using shell scripts but have found no solution there either.
Could any kind soul give me any insights to point me in the right direction please ?
Thanks in advance.