vi - replacing colons with tabs

vi - replacing colons with tabs

Post by Mike Roma » Sat, 12 Apr 2003 17:47:37



I'd like to be able to replace each colon with a tab.

Tried

:%s/:/\t/g

but that replaced each colon with "\t"

Is there a way to do this with vi?

If not, what Unix tools will work?

Thanks/

 
 
 

vi - replacing colons with tabs

Post by Sven Gucke » Sat, 12 Apr 2003 19:23:24



Quote:> I'd like to be able to replace each colon with a tab.
> Tried ":%s/:/\t/g" but that replaced each colon with "\t"
> Is there a way to do this with vi?

enter the tab as "CTRL-V TAB".
and read ":help i_CTRL-V" to
understand it (if you use vim).

Sven

 
 
 

vi - replacing colons with tabs

Post by Barry Kimelma » Sat, 12 Apr 2003 22:28:18


[This followup was posted to comp.unix.questions]



Quote:> I'd like to be able to replace each colon with a tab.

> Tried

> :%s/:/\t/g

> but that replaced each colon with "\t"

> Is there a way to do this with vi?

> If not, what Unix tools will work?

> Thanks/

Instead of typing "\t", try typing Ctrl-V followed by the TAB key.

Note: Any key typed after the Ctrl-V is treated litterally
(i.e. any special meaning is ignored).

--
---------

Barry Kimelman
Winnipeg, Manitoba, Canada

 
 
 

1. VI, replace <TAB> with <SPACE>

   hello all,
      is there a way for me to "Set" VI to use <SPACE>s rather than
      <TAB>.... i would like to press <TAB> and have VI insert
      5 <SPACE>s so when i go to print, my text isnt mis-aligned.

   Thanks,
      email me back....  Kirk Lim

2. Major HD Woes

3. Replacing tabs in vi

4. Playing sounds through the PC speaker or DAC

5. replacing tabs with emulated tabs

6. hard drive shows (unknow capacity)

7. entering tab in vi without using tab key

8. Problems with rlogin or rsh.

9. pdksh tab-completion problem with colons

10. Ohh, the old plus colon colon trick again.

11. Script GURUs - a tab is a tab is a tab

12. Q: How to replace TABS with SED-command?

13. replacing tabs with sed