On Mon, 2003-01-27 at 17:17, Cameron Simpson wrote:
> On 09:56 26 Jan 2003, Bret Hughes <[EMAIL PROTECTED]> wrote:
> | > | the g/foo/ one I am going to have to read up on before beginning to ask
> | > | a question about it :)
> | >
> | > Thinks of it like a pre-grep for the target lines.
> |
> |
On 09:56 26 Jan 2003, Bret Hughes <[EMAIL PROTECTED]> wrote:
| > | the g/foo/ one I am going to have to read up on before beginning to ask
| > | a question about it :)
| >
| > Thinks of it like a pre-grep for the target lines.
|
| Yeah I get the g/foo/ part it is the .-2,.+2m0 that looks like gi
On Sun, 2003-01-26 at 03:35, Cameron Simpson wrote:
> On 21:27 14 Jan 2003, Bret Hughes <[EMAIL PROTECTED]> wrote:
> | Am I close? this is more flexible than trying to build a regex that
> | would do the same thing in the syntax I have used in the past. I never
> | have sucessfully atomized let
On 21:27 14 Jan 2003, Bret Hughes <[EMAIL PROTECTED]> wrote:
| On Tue, 2003-01-14 at 20:50, Cameron Simpson wrote:
| > It separates selection from operation. It says, "globally, for all lines
| > containing abdfggg, substitute that (// being 'that') with opsmsdd".
| >
| > You can do more flexible
On 14 Jan 2003, Bret Hughes wrote:
> the g/foo/ one I am going to have to read up on before beginning to ask
> a question about it :)
>
> Bret
one of my favorite applications of that operator is to print all
lines containing a pattern while in vi with:
:g//p
as in
:g/root/p
the pattern
On Tue, 2003-01-14 at 20:50, Cameron Simpson wrote:
> On 11:01 14 Jan 2003, Bret Hughes <[EMAIL PROTECTED]> wrote:
> | On Mon, 2003-01-13 at 13:18, Samuel Flory wrote:
> | > [EMAIL PROTECTED] wrote:
> | > >or try:
> | > >:g/abdfggg/s//opsmsdd/g from vi/vim
> | >
> | > That's really the hard way.
>
On 11:01 14 Jan 2003, Bret Hughes <[EMAIL PROTECTED]> wrote:
| On Mon, 2003-01-13 at 13:18, Samuel Flory wrote:
| > [EMAIL PROTECTED] wrote:
| > >or try:
| > >:g/abdfggg/s//opsmsdd/g from vi/vim
| >
| > That's really the hard way.
| > :%s/abdfggg/opsmsdd/g works just as well and makes more sense.
On Mon, 2003-01-13 at 13:18, Samuel Flory wrote:
> [EMAIL PROTECTED] wrote:
>
> >or try:
> >:g/abdfggg/s//opsmsdd/g from vi/vim
> >
> >
> >
>
> That's really the hard way.
>
> :%s/abdfggg/opsmsdd/g works just as well and makes more sense.
>
This is the vi syntax I am familier with. What is
[EMAIL PROTECTED] wrote:
or try:
:g/abdfggg/s//opsmsdd/g from vi/vim
That's really the hard way.
:%s/abdfggg/opsmsdd/g works just as well and makes more sense.
PS- Remember that you can use anything as a delimiter in both vim and sed.
sed -e s/abcde/edcba/ is the same as sed -e s,abc
On Mon, 2003-01-13 at 05:45, Jianping Zhu wrote:
> Thanks.
> but a little confused by your advice
> can u give more detail?
Use sed, as was advised by Ric Tibbetts. That is what it's made for.
Forget anything else.
sed 's/abdfggg/opsmsdd/g' originalfile.txt > newfile.txt
> Thanks
>
> On Mon,
On Mon, 2003-01-13 at 06:06, Rechenberg, Andrew wrote:
> I don't believe that you can't substitute with grep or find. Do you
> have access to sed?
>
> sed -e 's/abdfgg/opsmsdd/g' filename > outputfilename
>
> If you have multiple files with text you wish to replace, then you could
> use 'grep -R
How about sed?
sed s/abdfggg/opsmsdd/g text_file
Mark
[EMAIL PROTECTED] wrote:
or try:
:g/abdfggg/s//opsmsdd/g from vi/vim
Good luck
Bob
Jack Bowling <[EMAIL PROTECTED]> wrote:
On Mon, Jan 13, 2003 at 08:21:44AM -0500, Jianping Zhu wrote:
how to substutue string in a text file by u
or try:
:g/abdfggg/s//opsmsdd/g from vi/vim
Good luck
Bob
Jack Bowling <[EMAIL PROTECTED]> wrote:
>On Mon, Jan 13, 2003 at 08:21:44AM -0500, Jianping Zhu wrote:
>>
>> how to substutue string in a text file by using "gerp" or "find"?
>>
>> I have a text file, lof of "abdfggg" in that text fil
On Mon, Jan 13, 2003 at 08:21:44AM -0500, Jianping Zhu wrote:
>
> how to substutue string in a text file by using "gerp" or "find"?
>
> I have a text file, lof of "abdfggg" in that text file, i need to change
> it to "opsmsdd", is there a simple way to do that?
Retrieve chgrep from freshmeat.ne
On Mon, Jan 13, 2003 at 08:55:42AM -0500, Robert P. J. Day wrote:
[...]
> my apologies -- i'd forgotten that that command comes with
> the mysql RPM.
replace is also available separately - see:
http://replace.richardlloyd.org.uk/
Cheerio,
Thomas
--
Jianping Zhu wrote:
how to substutue string in a text file by using "gerp" or "find"?
I have a text file, lof of "abdfggg" in that text file, i need to change
it to "opsmsdd", is there a simple way to do that?
sed is your friend.
sed 's/abdfggg/opsmsdd/g' >
That will replace ALL instances
I don't believe that you can't substitute with grep or find. Do you
have access to sed?
sed -e 's/abdfgg/opsmsdd/g' filename > outputfilename
If you have multiple files with text you wish to replace, then you could
use 'grep -R' to find them and if you're replacing with the same text in
each fi
om: Jianping Zhu [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 8:46 AM
To: [EMAIL PROTECTED]
Subject: RE: how to substutue string in a text file
Thanks.
but a little confused by your advice
can u give more detail?
Thanks
On Mon, 13 Jan 2003, Rick Carroll wrote:
>
On Mon, 13 Jan 2003, Jianping Zhu wrote:
> i use "man replace" but find nothing
>
> how to use replace?
>
> Thanks
>
> On Mon, 13 Jan 2003, Robert P. J. Day wrote:
>
> > On Mon, 13 Jan 2003, Jianping Zhu wrote:
> >
> > >
> > > how to substutue string in a text file by using "gerp" or "find"
Thanks.
but a little confused by your advice
can u give more detail?
Thanks
On Mon, 13 Jan 2003, Rick Carroll wrote:
> Use back-ticks `` (like single quotes in the opposite direction) around your
>command.
> Example MYVAR=`grep foo bar`
>
> This redirects the standard out of a command into a
i use "man replace" but find nothing
how to use replace?
Thanks
On Mon, 13 Jan 2003, Robert P. J. Day wrote:
> On Mon, 13 Jan 2003, Jianping Zhu wrote:
>
> >
> > how to substutue string in a text file by using "gerp" or "find"?
> >
> > I have a text file, lof of "abdfggg" in that text file
Use back-ticks `` (like single quotes in the opposite direction) around your command.
Example MYVAR=`grep foo bar`
This redirects the standard out of a command into a variable.
Rick
-Original Message-
From: Jianping Zhu [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 8:
On Mon, 13 Jan 2003, Jianping Zhu wrote:
>
> how to substutue string in a text file by using "gerp" or "find"?
>
> I have a text file, lof of "abdfggg" in that text file, i need to change
> it to "opsmsdd", is there a simple way to do that?
there's always the "replace" command.
rday
--
re
23 matches
Mail list logo