Re: OT: matched string of a regular expression

2009-03-14 Thread Kamaraju S Kusumanchi
Florian Kulzer wrote: > On Wed, Mar 04, 2009 at 16:24:27 -0500, kamaraju kusumanchi wrote: > > [...] > >> Now, >> I would like to replace all the occurrences of >> >> a(ijk)1b with a(ijk)23b >> a(jik)1b with a(jik)23b >> a(ikj)1b with a(ikj)23b >> and so on for all the strings such as a(???) >>

Re: OT: matched string of a regular expression

2009-03-04 Thread Tzafrir Cohen
On Wed, Mar 04, 2009 at 04:24:27PM -0500, kamaraju kusumanchi wrote: > Because of the size of the files involved, the number of files on > which I have to perform this operation I decided to use sed (instead > of doing it manually in vim) Do this *manually* in vim? There were suggestions for a n

Re: OT: matched string of a regular expression

2009-03-04 Thread Emanoil Kotsev
H.S. wrote: > Then > $> sed -e 's/\(a(.*)\)1b/\123b/' foo.dat > foo_new.dat > > Or just: > $> sed -e 's/1b/23b/' foo.dat > foo_new.dat > > if only 1b is to be replaced. Same thing using perl (will replace > contents of foo.dat inplace): > $> perl -p -i -e "s/1b/23b/g;" foo.dat > > > Regards p

Re: OT: matched string of a regular expression

2009-03-04 Thread Florian Kulzer
On Wed, Mar 04, 2009 at 16:24:27 -0500, kamaraju kusumanchi wrote: [...] > Now, > I would like to replace all the occurrences of > > a(ijk)1b with a(ijk)23b > a(jik)1b with a(jik)23b > a(ikj)1b with a(ikj)23b > and so on for all the strings such as a(???) > > Because of the size of the files in

Re: OT: matched string of a regular expression

2009-03-04 Thread H.S.
kamaraju kusumanchi wrote: > Consider the following file. > >> cat junk.txt > a(i)1b > a(j)1b > a(ij)1b > a(ji)1b > a(ijk)1b > a(jik)1b > a(ikj)1b > a(jki)1b > a(kij)1b > a(kji)1b > > In general the file is very long, might contain some other text. Now, > I would like to replace all the occurrenc

Re: OT: matched string of a regular expression

2009-03-04 Thread David Jardine
On Wed, Mar 04, 2009 at 04:24:27PM -0500, kamaraju kusumanchi wrote: > Consider the following file. > > > cat junk.txt > a(i)1b > a(j)1b > a(ij)1b > a(ji)1b > a(ijk)1b > a(jik)1b > a(ikj)1b > a(jki)1b > a(kij)1b > a(kji)1b > > In general the file is very long, might contain some other text. Now,

OT: matched string of a regular expression

2009-03-04 Thread kamaraju kusumanchi
Consider the following file. > cat junk.txt a(i)1b a(j)1b a(ij)1b a(ji)1b a(ijk)1b a(jik)1b a(ikj)1b a(jki)1b a(kij)1b a(kji)1b In general the file is very long, might contain some other text. Now, I would like to replace all the occurrences of a(ijk)1b with a(ijk)23b a(jik)1b with a(jik)23b a(i