On Jan 5, 2:00 pm, Jeremy Conlin <[email protected]> wrote:
> I have a text file that I want to put into columns, but I want to use
> spaces instead of tabs.  Is there an easy (i.e., not manual) way to do
> this?  A section of the file looks like:
>
> HEU-MET-FAST-001 1.0000(10) 0.9966(2) 1.0000(1)
> HEU-MET-FAST-004 0.9985 0.9948(3) 1.0003(1)
> HEU-MET-FAST-007.1 0.9950(24) 0.9901(1) 0.9931(1)
>
> I want the columns separated where now there is a single space.  Can
> someone help?
>

First, replace all single spaces with tab characters to get them into
columns.
:%s; ;\t;g

Then, set your tabstop to the desired column spacing. For example,
:set ts=12

Finally, replace all tabs with an appropriate number of spaces:
:set expandtab
:retab

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to