Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to open Vi editor in hexadecimal mode?

Posted on 2006-11-22
2
Medium Priority
?
1,361 Views
Last Modified: 2008-02-01
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
Comment
Question by:tatikor_143
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 2000 total points
ID: 17997299


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
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 17997304

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question