1827834 Members
2421 Online
109969 Solutions
New Discussion

vi editor question

 
Derek Brown
Frequent Advisor

vi editor question

Is there a way, while in vi, to see the file with all of its control codes included .... ie carriage returns, tabs etc ?

Many thanks
5 REPLIES 5
baiju_3
Esteemed Contributor

Re: vi editor question

For tabs and carriage retuns ,use

:set list

Control characters , not sure.

thx,
bl.
Good things Just Got better (Plz,not stolen from advertisement -:) )
Rodney Hills
Honored Contributor

Re: vi editor question

If you use "vim", the "-b" option allows you to edit a binary file.

HTH

-- Rod Hills
There be dragons...
A. Clay Stephenson
Acclaimed Contributor

Re: vi editor question

Not really. You can use Ctrl-V to escape control characters to allow you to input non-printable values there is no reliable mode to allow the display of non-printable characters. The first obvious problem is that now that LF's would not be handled, your entire file would be just one line long.

You can use the standard od or xd commands to display the data in human-readable form. Man od for details.

If you actually need to edit binary data, one of the best tools is hexedit.

http://gatekeep.cs.utah.edu/hppd/hpux/Development/Tools/hexedit-1.2.10/

If it ain't broke, I can fix that.
Derek Brown
Frequent Advisor

Re: vi editor question

excellent... thank you
Andrew Merritt_2
Honored Contributor

Re: vi editor question

Another way to do this is to use 'vis' and 'inv' to process the file before and after editing. This will let you see and edit any control characters.

Andrew