On 2009-11-23, [email protected] wrote:
> Hi,
> 
> I have a file with LOTS of constructions like this one (data below are
> pure fiction!):
> 
> 123,
> Detroit,
> 0.717,
> --,
> Kingston,
> aaabha00-XX
> 
> 1009,
> Munich,
> 0.454,
> SE,
> Prepton,
> FFXX019-FF
> 
> 126,
> Oslo,
> 2.002,
> T1,
> Nahasy,
> DDf-003-DD
> 
> (hundreds of this paragraphs...)
> 
> I want to get this:
> 
> 123, Detroit, 0.717, --, Kingston, aaabha00-XX
> 1009, Munich, 0.454, SE, Prepton, FFXX019-FF
> 126, Oslo, 2.002, T1, Nahasy, DDf-003-DD 
> 
> I know about 'J' but I dont know how to tell vim to do it
> "per paragraphs" and not to combine ALL into one big line...
> 
> Is this possible without involving scripts and macros?
> 
> Thank you very much for any help in advance!

First, set 'tw' to a value greater than the length of the longest
line of the final results.  Then type this:

    gggqG

That will reformat all the paragraphs to single lines.  (See ":help
gq".)  To delete the blank lines between paragraphs, execute this:

    :g/^$/d

HTH,
Gary



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to