Re: Help needed for 'sed'-ing a Hex file
On Tue, Apr 22, 2003 at 06:16:47PM +0200, Ronald van Engelen wrote:
> 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
Binary, you mean?
> 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:
'strings' from the binutils package is probably much easier.
> 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.
perl's regular expressions are a better choice for handling newlines
than sed's, but I'd need a clearer example of what you're trying to do.
However, if you use 'strings', I don't think you'll have this problem in
the first place.
Cheers,
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: