Re: VIM: How to split a line on spaces?
- From: Benjamin Esham <bdesham@xxxxxxxxx>
- Date: Fri, 02 Sep 2005 23:08:15 GMT
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
.
- Follow-Ups:
- Re: VIM: How to split a line on spaces?
- From: Fred
- Re: VIM: How to split a line on spaces?
- References:
- VIM: How to split a line on spaces?
- From: Fred
- VIM: How to split a line on spaces?
- Prev by Date: Re: GENERAL: Formatting text in Linux?
- Next by Date: Re: VIM: How to split a line on spaces?
- Previous by thread: VIM: How to split a line on spaces?
- Next by thread: Re: VIM: How to split a line on spaces?
- Index(es):
Relevant Pages
|