Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Case/lower/upper in vi
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
JAW  
View profile  
 More options Sep 19 2012, 11:00 am
Newsgroups: comp.unix.shell
From: JAW <jwill...@aglresources.com>
Date: Wed, 19 Sep 2012 08:00:41 -0700 (PDT)
Local: Wed, Sep 19 2012 11:00 am
Subject: Case/lower/upper in vi

I have a file  similar to the below with multiple entries of a similar nature.

I want to change /riskops/RISKOPS to /risktss/RISKTSS in one VM command. I can do it easily in two. Just basically the same string with one being lower case and the other being upper case as seen below.

From:

/u01/app/oracle/diag/rdbms/riskops/RISKOPS/cdump

to:

/u01/app/oracle/diag/rdbms/risktss/RISKTSS/cdump


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kenny McCormack  
View profile  
 More options Sep 19 2012, 11:25 am
Newsgroups: comp.unix.shell
From: gaze...@shell.xmission.com (Kenny McCormack)
Date: Wed, 19 Sep 2012 15:25:01 +0000 (UTC)
Local: Wed, Sep 19 2012 11:25 am
Subject: Re: Case/lower/upper in vi
In article <1f110714-6828-471b-b690-78b9ca538f3d@googlegroups.com>,

It is not at all clear what you're really talking about.

--
The motto of the GOP "base": You can't be a billionaire, but at least you
can vote like one.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Janis Papanagnou  
View profile  
 More options Sep 19 2012, 11:47 am
Newsgroups: comp.unix.shell
From: Janis Papanagnou <janis_papanag...@hotmail.com>
Date: Wed, 19 Sep 2012 17:46:59 +0200
Local: Wed, Sep 19 2012 11:46 am
Subject: Re: Case/lower/upper in vi
Am 19.09.2012 17:00, schrieb JAW:

> I have a file  similar to the below with multiple entries of a
> similar nature.

> I want to change /riskops/RISKOPS to /risktss/RISKTSS in one VM
> command. I can do it easily in two. Just basically the same string
> with one being lower case and the other being upper case as seen
> below.

Not sure if that is what you want; vim:

   :s/\(risk\)...\(.*\)\(RISK\).../\1tss\2\3TSS/

or

   :s/riskops\(.*\)RISKOPS/risktss\1RISKTSS/

or clarify.

Janis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Morton  
View profile  
 More options Sep 19 2012, 12:32 pm
Newsgroups: comp.unix.shell
From: "Ed Morton" <mortons...@gmail.com>
Date: Wed, 19 Sep 2012 16:32:52 GMT
Local: Wed, Sep 19 2012 12:32 pm
Subject: Re: Case/lower/upper in vi

JAW <jwill...@aglresources.com> wrote:

> I have a file  similar to the below with multiple entries of a similar
nature.

> I want to change /riskops/RISKOPS to /risktss/RISKTSS in one VM command.

I can do it easily in two. Just basically the same string with one being
lower case and the other being upper case as seen below.

> From:

> /u01/app/oracle/diag/rdbms/riskops/RISKOPS/cdump

> to:

> /u01/app/oracle/diag/rdbms/risktss/RISKTSS/cdump

If you're asking how to change one word to another and keep the case of
the letters the same, e.g. so that some command "X" when run like this:

   X/foo/bar/g

would change all occurrences of foo to bar and all occurrences of FOO to
BAR, there is no command like that.

    Ed.

Posted using www.webuse.net


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JAW  
View profile  
 More options Sep 19 2012, 12:34 pm
Newsgroups: comp.unix.shell
From: JAW <jwill...@aglresources.com>
Date: Wed, 19 Sep 2012 09:34:43 -0700 (PDT)
Local: Wed, Sep 19 2012 12:34 pm
Subject: Re: Case/lower/upper in vi

If you're asking how to change one word to another and keep the case of
the letters the same, e.g. so that some command "X" when run like this:

   X/foo/bar/g

would change all occurrences of foo to bar and all occurrences of FOO to
BAR, there is no command like that.

    Ed.

Ed clarified what I am seeking to do .

Same text with different case I am attemping to do in one command.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Espen  
View profile  
 More options Sep 19 2012, 2:43 pm
Newsgroups: comp.unix.shell
From: Dan Espen <des...@verizon.net>
Date: Wed, 19 Sep 2012 14:43:49 -0400
Local: Wed, Sep 19 2012 2:43 pm
Subject: Re: Case/lower/upper in vi

JAW <jwill...@aglresources.com> writes:
> If you're asking how to change one word to another and keep the case of
> the letters the same, e.g. so that some command "X" when run like this:

>    X/foo/bar/g

> would change all occurrences of foo to bar and all occurrences of FOO to
> BAR, there is no command like that.

>     Ed.

> Ed clarified what I am seeking to do .

> Same text with different case I am attemping to do in one command.

This may not be helpful to you,
but emacs does case preserving change quite nicely.

If you change abc to def and start with:

abc ABC Abc

You get:

def DEF Def

--
Dan Espen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Morton  
View profile  
 More options Sep 20 2012, 7:20 am
Newsgroups: comp.unix.shell
From: Ed Morton <mortons...@gmail.com>
Date: Thu, 20 Sep 2012 06:20:55 -0500
Local: Thurs, Sep 20 2012 7:20 am
Subject: Re: Case/lower/upper in vi
On 9/19/2012 11:34 AM, JAW wrote:

> If you're asking how to change one word to another and keep the case of
> the letters the same, e.g. so that some command "X" when run like this:

>     X/foo/bar/g

> would change all occurrences of foo to bar and all occurrences of FOO to
> BAR, there is no command like that.

>      Ed.

> Ed clarified what I am seeking to do .

> Same text with different case I am attemping to do in one command.

You'll need a vim plugin then. A quick google search shows you can use these

    http://www.vim.org/scripts/script.php?script_id=6
    http://vim.wikia.com/wiki/Script:6

or this:

    https://github.com/tpope/vim-abolish

Apparently after installing them the "S" (for the second one or "%SC" for the
first) command will let you do:

    :S/foo/bar/g

to replace 'Foo foo FOO' with 'Bar bar BAR'.

For more help I'd recommend you go to an editors NG or poke around the web pages
I mention above.

Regards,

     Ed.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ivan Shmakov  
View profile  
 More options Sep 20 2012, 8:10 am
Newsgroups: comp.editors, comp.unix.shell
Followup-To: comp.editors
From: Ivan Shmakov <oneing...@gmail.com>
Date: Thu, 20 Sep 2012 19:10:04 +0700
Local: Thurs, Sep 20 2012 8:10 am
Subject: Re: Case/lower/upper in vi

>>>>> Ed Morton <mortons...@gmail.com> writes:
>>>>> On 9/19/2012 11:34 AM, JAW wrote:

[...]

 >> Same text with different case I am attemping to do in one command.

 > You'll need a vim plugin then. A quick google search shows you can
 > use these

 >    http://www.vim.org/scripts/script.php?script_id=6
 >    http://vim.wikia.com/wiki/Script:6

 > or this:

 >    https://github.com/tpope/vim-abolish

 > Apparently after installing them the "S" (for the second one or "%SC"
 > for the first) command will let you do:

 >    :S/foo/bar/g

 > to replace 'Foo foo FOO' with 'Bar bar BAR'.

 > For more help I'd recommend you go to an editors NG

        That's what cross-posting is for, BTW.

        (... Setting Followup-To: to news:comp.editors just as well.)

 > or poke around the web pages I mention above.

--
FSF associate member #7257


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Janis Papanagnou  
View profile  
 More options Sep 20 2012, 11:43 am
Newsgroups: comp.unix.shell
From: Janis Papanagnou <janis_papanag...@hotmail.com>
Date: Thu, 20 Sep 2012 17:43:51 +0200
Local: Thurs, Sep 20 2012 11:43 am
Subject: [OT] Re: Case/lower/upper in vi
Am 20.09.2012 13:20, schrieb Ed Morton:
[...]
> You'll need a vim plugin then. A quick google search shows you can use

[ links to plugins snipped ]

> Apparently after installing them the "S" (for the second one or "%SC"
> for the first) command will let you do:

>     :S/foo/bar/g

> to replace 'Foo foo FOO' with 'Bar bar BAR'.

Curious; how would that plugin (or the respective emacs function) handle

       :S/foo/bart/g

if applied on the quoted data ('Foo foo FOO')? - A literal small 't' in
all three parts ('Bart bart BARt'), or some magic like 'Bart bart BART'?

Janis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Morton  
View profile  
 More options Sep 20 2012, 12:26 pm
Newsgroups: comp.unix.shell
From: "Ed Morton" <mortons...@gmail.com>
Date: Thu, 20 Sep 2012 16:26:34 GMT
Local: Thurs, Sep 20 2012 12:26 pm
Subject: Re: [OT] Re: Case/lower/upper in vi

From what I read on the web pages, it looks like the last one. I also saw an
example where they somehow do a translation on a mixed case word, but I can't
find that now and I can't be bothered to look for it again. At least one of
the macros I posted links to can also convert foo_bar to fooBar, etc. Google
(and maybe comp.editors) is your friend...

    Ed.

Posted using www.webuse.net


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bacarisse  
View profile  
 More options Sep 20 2012, 1:11 pm
Newsgroups: comp.unix.shell
From: Ben Bacarisse <ben.use...@bsb.me.uk>
Date: Thu, 20 Sep 2012 18:11:09 +0100
Local: Thurs, Sep 20 2012 1:11 pm
Subject: Re: [OT] Re: Case/lower/upper in vi
Janis Papanagnou <janis_papanag...@hotmail.com> writes:

<snip>

> Curious; how would that plugin (or the respective emacs function) handle

>       :S/foo/bart/g

> if applied on the quoted data ('Foo foo FOO')? - A literal small 't' in
> all three parts ('Bart bart BARt'), or some magic like 'Bart bart
> BART'?

Emacs does the magic one.  The term suggests you think this option is a
little mysterious, but it seem like the natural option to me.

--
Ben.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Janis Papanagnou  
View profile  
 More options Sep 20 2012, 1:45 pm
Newsgroups: comp.unix.shell
From: Janis Papanagnou <janis_papanag...@hotmail.com>
Date: Thu, 20 Sep 2012 19:45:51 +0200
Local: Thurs, Sep 20 2012 1:45 pm
Subject: Re: [OT] Re: Case/lower/upper in vi
On 20.09.2012 19:11, Ben Bacarisse wrote:

> Janis Papanagnou <janis_papanag...@hotmail.com> writes:
> <snip>
>> Curious; how would that plugin (or the respective emacs function) handle

>>       :S/foo/bart/g

>> if applied on the quoted data ('Foo foo FOO')? - A literal small 't' in
>> all three parts ('Bart bart BARt'), or some magic like 'Bart bart
>> BART'?

> Emacs does the magic one.  The term suggests you think this option is a
> little mysterious, but it seem like the natural option to me.

Not mysterious, but you can't tell whether that's the "Right Thing" to
assume be the only answer; I think it depends on the context. Example:
You have in a text some misspelled, or rather syntactically malformed,
words: "My set of dvc is as large as your set of DVC." and you, maybe,
want it to become: "My set of dvds is as large as your set of DVDs.",
then the plural 's' should not be capitalised. Maybe this ad hoc made
up case is rarer than the ones covered by the "magic" behaviour, but
possible anyway, and thus it depends. But maybe emacs' "magic" is so
advanced that it handles even that case. ;-)

Janis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile  
 More options Sep 20 2012, 2:34 pm
Newsgroups: comp.unix.shell
From: Barry Margolin <bar...@alum.mit.edu>
Date: Thu, 20 Sep 2012 14:34:28 -0400
Local: Thurs, Sep 20 2012 2:34 pm
Subject: Re: [OT] Re: Case/lower/upper in vi
In article <k3fkn2$pd...@news.m-online.net>,
 Janis Papanagnou <janis_papanag...@hotmail.com> wrote:

These things are heuristics. By definition, a heuristic is intended to
handle the common case, but it shouldn't be expected to be perfect.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Gibson  
View profile  
 More options Sep 20 2012, 5:36 pm
Newsgroups: comp.unix.shell
From: dave.gma+news...@googlemail.com.invalid (Dave Gibson)
Date: Thu, 20 Sep 2012 22:34:22 +0100
Local: Thurs, Sep 20 2012 5:34 pm
Subject: Re: [OT] Re: Case/lower/upper in vi

<http://groups.google.com/group/comp.lang.awk/tree/browse_frm/month/20...>

HARLAN!  HARLAN!!!  BECAUSE THAT WOULDN'T RESPECT LITERAL REGULAR
EXPRESSIONS.  YESSSSSS!

> and I can't be bothered to look for it again.

:|


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Janis Papanagnou  
View profile  
 More options Sep 21 2012, 4:26 am
Newsgroups: comp.unix.shell
From: Janis Papanagnou <janis_papanag...@hotmail.com>
Date: Fri, 21 Sep 2012 10:26:25 +0200
Local: Fri, Sep 21 2012 4:26 am
Subject: Re: [OT] Re: Case/lower/upper in vi
Am 20.09.2012 20:34, schrieb Barry Margolin:

To be useful that feature (as every function) should be well defined.
My question was, how does it (emacs, vim plugin) behave in cases where
two sensible applications/interpretations/functions are possible. Even
any approach based on a heuristic evaluation what might be considered
more useful in most cases should be well defined for an editor operator.
My question was not about a "perfect solution", rather about the chosen
actual implementation.

Janis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »