Operating System - HP-UX
1753401 Members
7207 Online
108792 Solutions
New Discussion юеВ

Re: can I use 'vi' to edit the file with the suffix 'bin'??

 
xxl_1
Frequent Advisor

can I use 'vi' to edit the file with the suffix 'bin'??

ask a simple problem:

how I can edit the file with the suffix 'bin'?
15 REPLIES 15
Vibhor Kumar Agarwal
Esteemed Contributor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

Yes you can but the ouput will not be understanable.
Vibhor Kumar Agarwal
Arunvijai_4
Honored Contributor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

If its a data file or ascii file, you can edit with "vi". If its a binary file, you cant do anything with "vi". Try # file and check the type before opening in "vi"

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
RAC_1
Honored Contributor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

what does file "your_file" say??
vi is not helpful if it is a binary file.
There is no substitute to HARDWORK
Muthukumar_5
Honored Contributor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

Check out file information as,

# file

It has to be in text format to edit it. If it is a object file then it will not be in readable format.

If it is a text formatted one then use perl / sed to edit.

hth.
Easy to suggest when don't know about the problem!
Joseph Loo
Honored Contributor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

hi,

do this first:

# file
if it is a text/ascii file, editing will make sense, else quite pointless.

regards.
(p.s. please remember to assign points.)
what you do not see does not mean you should not believe
Orhan Biyiklioglu
Respected Contributor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

If you really need to edit a binary file try using hexedit http://hpux.connect.org.uk/hppd/hpux/Development/Tools/hexedit-1.2.10/

hth
Kryno Bosman
Advisor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

Check with file if the file is (read/edit)able. If it is you can try with vi. Otherwise, you can't.
Simplicity is too difficult for idiots like you and me...
xxl_1
Frequent Advisor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

I type the command:
#file cluma
cluma :command text( this is output)


can I edit it with "vi"?
MarkSyder
Honored Contributor

Re: can I use 'vi' to edit the file with the suffix 'bin'??

Yes you can.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing