[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Help needed for 'sed'-ing a Hex file



Hi,

I'm trying to use some commands from base-utils (like sed, grep and awk)
to extract a list of filenames from a Cubase generated RIFF file. The
file is a HEX file and I'm having the following problems at the start of
the process:

1. Extract text from the hex file: 
I've looked at hexdump and hexcurses, but both won't let me make a
text-only dump of the strings in the hex file. Now I have to use
KHEXEDIT and as you may understand I would like to have a more basic
method:

String portion of the riff file:
1: RIFF..AbNUNDROOT........Pool1....PPoolARCH..A@ÿÿÿþ....GModel...ÿ
2: ÿÿþ....FShared...ÿÿÿþ....CmObject...ÿÿÿÿ....PPool.....@öÿÿÿÿ....
3: GTree.....@9ÿÿÿþ....CmIDLink...ÿÿÿÿ....GTreeEntry.....@......p..
4: .....q..?µ.....Z...(...q....ÿÿÿþ....PMediaDescriptor...ÿÿÿþ....M
5: ListNode...ÿÿÿþ....MDataNode...ÿÿÿÿ....PAudioClip......-....5 Hi
6: Hat_13.....>÷ÆøÇQñw....ÿÿÿþ....FPath...ÿÿÿÿ....FNPath..........
7: .5 Hi Hat_13.wav.EVAW....wav.....wav.....Wave File.........._D:\
8: Bands\Band X\Projecten\Studio Starsound\Tracks\Kopie van 01 Toge
9: ther\VERSIES\BEWERKT\Audio\...........¿Ç.à$h¬ñ....ÿÿÿþ....AudioS

The path of the file (D:\Bands\Band
X\Projecten\StudioStarsound\Tracks\Kopie van 01
Together\VERSIES\BEWERKT\Audio\) is displayed across lines 7, 8 and 9.
The actual filename (5 Hi Hat_13.wav) is on line 7. 

Note that both the path- and filenames contain spaces.


2. KHEXEDIT outputs a standard text file with line-wrapping at column
80. I need to get rid of the EOL markers as well, because the filenames
I'm looking for are spread on multiple lines. I've tried a lot but it
seems to me that sed can't find strings which are not on one line(?).
Currently I use Anjuta to replace the LF markers with nothing.

From here everything works with a few sed and cut commands and I
eventually get a nice list of (.wav) files on each line.


Thanks,
Ronald van Engelen

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: