Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1363
  • Last Modified:

How to open Vi editor in hexadecimal mode?

I am using a vi editor in a solaris environment and I want to open a binary log file contains all addresses which has been extracted from a switch.I want to display the contents in it in a hexadecimal format.How can i do the same using vi editor ?

And also ow can I use a emacs editor to do the same?
0
tatikor_143
Asked:
tatikor_143
  • 2
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:


Vi won't edit the binary file as it deals with text strings.

However, you can use xxd to convert the file, edit it, and use xxd to convert it back.

Put it in a small shell script and it looks like a single command.  :)

xxd oldfile tempfile
vi tempfile
xxd -r tempfile oldfile


Good Luck,
kent
0
 
Kent OlsenData Warehouse Architect / DBACommented:

I guess that this should be moved to the unix forum, but most of the C experts here are unix geeks, too.  :)  


Besides, we're friendlier over here.
Kent
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now