Monday, April 25, 2011

Trying to standardize exports

I am trying to standardize my exports file. I need to remove all spaces and tabs between the first two fields and replace them with two tabs. I am using VI.

So I want to change

/vol/vol1/home1/xxx -rw=admin:app:admhosts

to

/vol/vol1/home1/xxx -rw=admin:app:admhosts

making the space equil to To two TABS.

I am using VI.

From stackoverflow
  • Do :s/[ ^I]\+/^I^I/ for a single line, or :%s/[ ^I]\+/^I^I/ for the whole file. Note that I mean ^I to mean you press Ctrl+I

    Judge Maygarden : I've used ^I before, but always forget it. Do you have a link to a quick reference for these special characters in vim?
    dwc : I should have mentioned that ^I is Tab. Pressing the Tab key will do just fine. These are not really special vim keys, just standard ones. Any decent ASCII table will give you the info.

0 comments:

Post a Comment