[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: vi globally append question



On Thu, Jul 15, 2004 at 12:06:07PM -0400, David Turetsky wrote:
> 
> David Turetsky wrote:
> 
> >>:%s/^[a-z]:[0-9]/#/g
> 
> > Try something like:
> 
> >   %g!/^#/s/^/#/
> 
> > Steve Lamb replied:
> 
> >    Personally I'd do it this way:
> >    %s/\(.*\)/#\1/g
> 
> David responded:
> 
>   Steve's approach would put a # in the front of ALL
>   lines whether or not they initially contain an existing
>   # to begin with
> 
>   If that is what you wanted to do, you could:
> 
>     %s/^/#/

Then follow that with %s/^##/#/ to end up with the desired result, I 
think...

Ken

-- 
Ken Irving, Research Analyst, fnkci@uaf.edu, 907-474-6152
Water and Environmental Research Center
Institute of Northern Engineering
University of Alaska, Fairbanks



Reply to: