1830937 Members
1915 Online
110017 Solutions
New Discussion

VI question

 
Hunki
Super Advisor

VI question

Hi All,

I have this piece of text in which I need to move the text to one space ahead.
Here is the text :
12233
324234
12321342
and I want to make it look like :
12233
324234
12321342

How do I do it through vi , there is a lot of text to be done.Doing individual lines wud be a pain.

Thanks to a the nice samaritans.

Hunki
4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: VI question

Considering that the Forums screw up the formatting, you post doesn't really show any difference.

Is it that you just want to add a space at the beginning of the line? If so, do the following in vi:

:1,$s/^/ /g

Note that you must NOT be in insert/edit mode to do this. Hit ESC a couple of times first to make sure. Also not that there is a space between the last 2 / characters.
Patrice Le Guyader
Respected Contributor

Re: VI question

Hi,

Try this :
:1,$ s/^ //g
Note there is a space betwwen ^and //

Hope this helps
Kenavo
Pat
Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
James R. Ferguson
Acclaimed Contributor

Re: VI question

Hi:

I assume that you mean move up one line (row)? If so:

3dd

P

Regards!

...JRF...
Hunki
Super Advisor

Re: VI question

Thanks All