Solved

How to open Vi editor in hexadecimal mode?

Posted on 2006-11-22
2
1,312 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
  • 2
2 Comments
 
LVL 45

Accepted Solution

by:
Kdo earned 500 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 45

Expert Comment

by:Kdo
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

706 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now