?
Solved

How to open Vi editor in hexadecimal mode?

Posted on 2006-11-22
2
Medium Priority
?
1,355 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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

752 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