Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a fairly large binary file (a few tens of MB) and would like to remove a few KB somewhere in the middle, it's sandwiched data not the beginning nor the end.

Ideally I'd like to use emacs and hexl-mode seems a likely candidate.

Is it possible to delete one line from hexl buffer? Ctrl-k does not seem to do the job. I'm happy to look at the code but for whatever reason looking for hexl-mode.el all I find is the compiled .elc file on my Ubuntu 10.04 machine Emacs 23.1.

Additionally: in a sneaky move I'd like to add another hexl-mode question that is not directly related to the question as phrased in the title but is part of the complete problem I'm facing: It would be very useful for me if I could display X hexadecimal characters per line where X obviously changes with the format of the binary file I'm editing, I could not find a way to do that with hexl-mode and thought I'll throw the question here.

share|improve this question

1 Answer 1

Hexl mode does not allow you to delete characters. This answer from stack overflow suggests a workaround: overwrite the characters you want to delete with another character (say "X"), switch out of hexl mode, find the characters and delete them there.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.