Re: VIM: How to split a line on spaces?



Fred wrote:

> I have some lines of text in a file like this:
>
> this is the first line of text
> this is the second line of text
>
> How can I split these lines of text on the third and fifth space, so that
> they look like this:
>
> first line
> second line

Try

:%s/^\%(\S\+\s\+\)\{3}\(\S\+\s*\)\{2}.\+$/\1/

HTH,
--
Benjamin D. Esham
bdesham@xxxxxxxxx | http://bdesham.net | AIM: bdesham128
"Science is a differential equation. Religion is a boundary
condition." — Alan Turing
.



Relevant Pages

  • Re: Second class posters
    ... Science is a differential equation. ... Religion is a boundary condition. ... So to this non-mathematician it appears as if Turing is saying that religion is necessary for the "solution" of science. ...
    (uk.religion.christian)
  • Re: Nonthaburi
    ... Science is a differential equation. ... Religion is a boundary condition. ...
    (soc.culture.thai)
  • Re: Second class posters
    ... Science is a differential equation. ... Religion is a boundary condition. ...
    (uk.religion.christian)
  • Re: Suggesting a Poll
    ... The language of international diplomacy used to be French. ... Science is a differential equation. ... Religion is a boundary condition. ...
    (sci.math)
  • RE: SPAM: Re: [SLE] Schedule of releases
    ... Math is not science, yet clearly it is rational, hence ... but religion is not among them. ... Prev by Date: ...
    (SuSE)