How can we print hex values without offsets using hexdump?

  • Thread starter heartless
  • Start date
In summary, there is a way to prompt hexdump to print just the hex values of a file without offsets by using a program called colrm or by writing a script in a language like C, python, or perl. This can save time and make the output more organized.
  • #1
heartless
220
2
Hello people,
Is there any way to prompt hexdump to print just the hex values of the file without offsets, f.ex normally when you hex your file it looks something like this:

0000b10 ec33 b3b2 4b3b e293 7ef9 f73e 3333 9ce7

and we want to make it:

ec33 b3b2 4b3b e293 7ef9 f73e 3333 9ce7

Any ideas?

Thanks,
 
Computer science news on Phys.org
  • #2
You could just run the output through another program that reformats it the way you want. It would take probably 5 minutes to write a C program to do it, and even faster in a scripting language like python or perl, or to use sed if you know them.

(Yes, this is a plug for learning a scripting language. :biggrin:)

But, in this case, there is already a program to do essentially what you want: colrm.
 
Last edited:
  • #3


One potential solution would be to use the "cut" command in conjunction with the "hexdump" command. This would allow you to specify which columns of the hexdump output you want to keep, and in this case, you would only keep the hex values without the offset. For example, you could use the command "hexdump -C <file> | cut -c 9-" to remove the first 8 columns (which contain the offset) and only display the hex values. I hope this helps!
 

FAQ: How can we print hex values without offsets using hexdump?

What is the purpose of "Don't print the crazy offset"?

The purpose of this phrase is to remind people to check and adjust their printer settings before printing a document, to avoid wasting paper and ink on a poorly formatted printout.

Why is it important to not print with a crazy offset?

Printing with a crazy offset can result in a misaligned printout, causing important information to be cut off or distorted. It can also waste paper and ink, which is harmful to the environment and can be costly.

How can I avoid printing with a crazy offset?

You can avoid printing with a crazy offset by adjusting your printer settings to ensure that the margins and alignment are correct before printing. You can also do a test print to check for any formatting issues before printing your document.

What happens if I ignore the warning and print with a crazy offset?

If you ignore the warning and print with a crazy offset, your printout may be misaligned, making it difficult to read or use. This can also result in wasted paper, ink, and time.

Can I still print my document if it has a crazy offset?

Yes, you can still print your document if it has a crazy offset, but it is not recommended. It is best to adjust your printer settings or fix any formatting issues before printing to avoid any potential problems.

Back
Top