vi editor

suppose i have a lines as follows

-rw-r----- 1 ora92 orainst 104846848 Jan 15 2005 0001_0000003971.arc
-rw-r----- 1 ora92 orainst 104851456 Jan 15 2005 0001_0000003972.arc
-rw-r----- 1 ora92 orainst 104852992 Jan 15 2005 0001_0000003973.arc
-rw-r----- 1 ora92 orainst 104855040 Jan 15 2005 0001_0000003974.arc
-rw-r----- 1 ora92 orainst 104846848 Jan 15 2005 0001_0000003975.arc
-rw-r----- 1 ora92 orainst 104849408 Jan 15 2005 0001_0000003976.arc
-rw-r----- 1 ora92 orainst 104844288 Jan 15 2005 0001_0000003977.arc
-rw-r----- 1 ora92 orainst 104856576 Jan 15 2005 0001_0000003978.arc

I want to replace
-rw-r----- 1 ora92 orainst 104846848 Jan 15
portion with mv for all the lines.

Any suggestions from anyone??

Dip

:%s/.*15/mv/
should do it. But you really want that 2005 to stay put??

Thnx for reply but this did not work

Make sure that there is no space between % ans s or use an explicit line number range:

:1,$ s/.*15/mv/

nothing is working

Paste into a reply to this thread exactly what you are typing into VI and we'll tell you what you are doing wrong. Perhaps you are in Insert mode while you are trying to make this work. Hit Escape before typing it in.

well i am aware of the insert mode and ex mode. and i am in ex mode when i am running this commands. can you specify me the blank spaces in the command. i think that will help me.

While you are in EX mode, copy and paste this in:

1,$ s/.*15/mv/

By the way, EX mode is not the same as command mode when entering commands. In EX more, leave off the colon ":".

The command I gave was for visual mode. Type "vi filename" to start vi. Now the next character you type should be the colon of my command:
:%s/.*15/mv/
There are no spaces. After the final slash you must hit your enter key.

i am sorry it's not working!

It works for me. Oh well. You can't win them all. Sorry I couldn't help you.

is it necessary to use vi editor because there are other ways of doing it

Hi All,

I guess VI can be replaced by Joe Editor for this purpose.
What you say?

Thanks
Diptiman Singh

http://www.deetechnologies.com

Oh, yeah, that's gonna work. Replace the whole editor because someone can't type a command...

:%s/.*15/mv/ works just fine. Guy can't type it, guy can't type it.

I guess usernames diptimansingh and diptiman belong to the same individual.