On Wednesday 05 January 2011 14:00:44 Jeremy Conlin 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?

assuming you have awk available you could create a filter
module, let's call it columnize.awk

<columnize.awk>
{ print "%-18s %9s %9s %9s", $1, $2, $3, $4 }
</columnize.awk>

and call it from a vim session with

    :%!awk -f columnize.awk

i haven't tested this so it may need tweaking to your taste

sc

-- 
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