Re: vi globally append question

2004-07-15 Thread Patrick Albuquerque
From: Rick Pasotto <[EMAIL PROTECTED]> > On Thu, Jul 15, 2004 at 10:05:43PM -0500, Patrick Albuquerque wrote: > > From: Sean <[EMAIL PROTECTED]> Date: Thursday, July 15, 2004 8:49 > > am Subject: vi globally append question > > > > > hi all, > > > > > > i have a file like; > > > > > > # one 123

Re: vi globally append question

2004-07-15 Thread Rick Pasotto
On Thu, Jul 15, 2004 at 10:05:43PM -0500, Patrick Albuquerque wrote: > From: Sean <[EMAIL PROTECTED]> Date: Thursday, July 15, 2004 8:49 > am Subject: vi globally append question > > > hi all, > > > > i have a file like; > > > > # one 123 > > > > and i would like to APPEND a # at the beginning

Re: vi globally append question

2004-07-15 Thread Patrick Albuquerque
From: Sean <[EMAIL PROTECTED]> Date: Thursday, July 15, 2004 8:49 am Subject: vi globally append question > hi all, > > i have a file like; > > # > one > 123 > > and i would like to APPEND a # at the beginning of > each line which is not started with a # . how can i do > it with vi or ed, so fa

Re: vi globally append question

2004-07-15 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 02:25:52PM -0400, Rick Pasotto wrote: > On Thu, Jul 15, 2004 at 07:45:26PM +0200, Matthias Czapla wrote: > > On Thu, Jul 15, 2004 at 11:05:32AM -0400, David Turetsky wrote: > > > > i have a file like; > > > > > > > > # > > > > one > > > > 123 > > > > > > > > and i would li

Re: vi globally append question

2004-07-15 Thread Rick Pasotto
On Thu, Jul 15, 2004 at 07:45:26PM +0200, Matthias Czapla wrote: > On Thu, Jul 15, 2004 at 11:05:32AM -0400, David Turetsky wrote: > > > i have a file like; > > > > > > # > > > one > > > 123 > > > > > > and i would like to APPEND a # at the beginning of > > > each line which is not started with a

Re: vi globally append question

2004-07-15 Thread Ken Irving
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 ap

Re: vi globally append question

2004-07-15 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 11:05:32AM -0400, David Turetsky wrote: > > i have a file like; > > > > # > > one > > 123 > > > > and i would like to APPEND a # at the beginning of > > each line which is not started with a # . how can i do > > it with vi or ed, so far, i 've tried; > > > > :%s/^[a-z]:[0

Re: vi globally append question

2004-07-15 Thread Robert Waldner
On Thu, 15 Jul 2004 06:49:20 PDT, Sean writes: >and i would like to APPEND a # at the beginning of >each line which is not started with a # . how can i do >it with vi or ed, so far, i 've tried; > >:%s/^[a-z]:[0-9]/#/g > >but this would CHANGE the first character of each line >to a hash, pls help.

Re: vi globally append question

2004-07-15 Thread Steve Lamb
David Turetsky wrote: > Steve's approach would put a # in the front of ALL > lines whether or not they initially contain an existing > # to begin with Oh, uh, whoops. :) Well, at least he'd see the \(.*\) and \1 move the text over and hopefully know to take the set he constructed, plac

RE: vi globally append question

2004-07-15 Thread David Turetsky
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 existi

Re: vi globally append question

2004-07-15 Thread Steve Lamb
David Turetsky wrote: >>:%s/^[a-z]:[0-9]/#/g > Try something like: > %g!/^#/s/^/#/ Personally I'd do it this way: %s/\(.*\)/#\1/g I know there are more concise ways to do it but this at least shows why the approach the OP took was not working. -- Steve C. Lamb | I'

RE: vi globally append question

2004-07-15 Thread David Turetsky
> -Original Message- > From: Sean [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 15, 2004 9:49 AM > To: debian-user > Subject: vi globally append question > > hi all, > > i have a file like; > > # > one > 123 > > and i would like to APPEND a # at the beginning of > each line which is

Re: vi globally append question

2004-07-15 Thread Derrick 'dman' Hudson
On Thu, Jul 15, 2004 at 10:24:32AM -0400, Rick Pasotto wrote: | On Thu, Jul 15, 2004 at 06:49:20AM -0700, Sean wrote: | > hi all, | > | > i have a file like; | > | > # one 123 | > | > and i would like to APPEND a # at the beginning of each line | | 'append' means to add to the end. It is imposs

Re: vi globally append question

2004-07-15 Thread Rick Pasotto
On Thu, Jul 15, 2004 at 06:49:20AM -0700, Sean wrote: > hi all, > > i have a file like; > > # one 123 > > and i would like to APPEND a # at the beginning of each line 'append' means to add to the end. It is impossible to append to the beginning of something. > which is not started with a # . h