How can we print hex values without offsets using hexdump?

  • Thread starter Thread starter heartless
  • Start date Start date
Click For Summary
SUMMARY

The forum discussion focuses on the need to print hex values from a file using the hexdump command without displaying offsets. Users suggest using alternative methods to achieve this, including writing a simple C program or utilizing scripting languages like Python or Perl. Additionally, the tool 'colrm' is recommended as an existing solution that can format the output to exclude offsets, providing a quick and efficient way to obtain the desired hex output.

PREREQUISITES
  • Familiarity with the hexdump command
  • Basic knowledge of scripting languages such as Python or Perl
  • Understanding of the colrm utility for text processing
  • Experience with C programming for custom solutions
NEXT STEPS
  • Learn how to use the colrm command for text formatting
  • Explore Python scripting for file manipulation and output formatting
  • Investigate Perl's capabilities for processing hex data
  • Write a C program to customize hex output from files
USEFUL FOR

This discussion is beneficial for software developers, system administrators, and anyone involved in data processing who needs to manipulate hex output from files efficiently.

heartless
Messages
220
Reaction score
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
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:

Similar threads

  • · Replies 14 ·
Replies
14
Views
4K
Replies
15
Views
11K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 43 ·
2
Replies
43
Views
4K
  • · Replies 22 ·
Replies
22
Views
3K
Replies
5
Views
3K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K