+ Reply to Thread
Results 1 to 7 of 7

Replace using wildcards

  1. #1
    jeb
    Guest

    Replace using wildcards

    Hi,
    I'm a newbie to Excel and this group so please excuse my ignorance.

    I'm trying to do what should be a pretty simple find and replace. I want to
    replace:
    base=xyz*cntry=123*type=simple
    wist
    base=differentbase*cntry=123*type=simple

    I have to include the type field in my search and the asterik's are part of
    the text, not wildcards. The only thing I want to change is the base.
    I put this in for the search criteria:
    base=xyz*cnty=???*type=simple
    This finds all the lines I'm looking for so, so far, so good.
    For the replace string, I use this:
    base=differentbase*cntry=???*type=simple

    The result is that it changes all the cntry='s to ??? instead of just
    leaving them alone.

    Any suggestions appreciated.

  2. #2
    Peo Sjoblom
    Guest

    RE: Replace using wildcards

    Precede the wildcard with a tilde

    ~* instead of *

    Regards,

    Peo Sjoblom


    "jeb" wrote:

    > Hi,
    > I'm a newbie to Excel and this group so please excuse my ignorance.
    >
    > I'm trying to do what should be a pretty simple find and replace. I want to
    > replace:
    > base=xyz*cntry=123*type=simple
    > wist
    > base=differentbase*cntry=123*type=simple
    >
    > I have to include the type field in my search and the asterik's are part of
    > the text, not wildcards. The only thing I want to change is the base.
    > I put this in for the search criteria:
    > base=xyz*cnty=???*type=simple
    > This finds all the lines I'm looking for so, so far, so good.
    > For the replace string, I use this:
    > base=differentbase*cntry=???*type=simple
    >
    > The result is that it changes all the cntry='s to ??? instead of just
    > leaving them alone.
    >
    > Any suggestions appreciated.


  3. #3
    jeb
    Guest

    RE: Replace using wildcards

    Peo,
    Thanks for the suggestion but I did that, too. I did this find:
    base=xyz~*cnty=???~*type=simple
    For the replace string, I used this:
    base=differentbase~*cntry=???~*type=simple
    I also used this replace with the find above:
    base=differentbase~**

    The result in both cases was that the string got changed to the EXACT string
    I typed in, tilde's and all.

    John

    "Peo Sjoblom" wrote:

    > Precede the wildcard with a tilde
    >
    > ~* instead of *
    >
    > Regards,
    >
    > Peo Sjoblom



  4. #4
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Excuse me for jumping into this, but <only> use the wildcards in the Find operation, not the replace. Type in the EXACT information you want the cell to end up with.

    Good Luck!
    Bruce
    The older I get, the better I used to be.
    USA

  5. #5
    jeb
    Guest

    Re: Replace using wildcards

    Thanks but I can't do it that way. There are hundreds of different cntry's in
    the find list. So it could be 123 or 456, etc. That's why I use ??? in the
    find statement, so I find them all. But I don't want to change that value
    when I do the replace.

    So the lines I'm searching for could be:
    base=xyz*cntry=123*type=simple
    base=xyz*cntry=456*type=simple
    base=xyz*cntry=789*type=simple

    I want to find all the different cntry's but only of type simple. There are
    multiple type's, too, so I have to define it in my search.

    John



    "swatsp0p" wrote:

    >
    > Excuse me for jumping into this, but <only> use the wildcards in the
    > Find operation, not the replace. Type in the EXACT information you
    > want the cell to end up with.
    >
    > Good Luck!
    >
    >
    > --
    > swatsp0p
    >
    >
    > ------------------------------------------------------------------------
    > swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
    > View this thread: http://www.excelforum.com/showthread...hreadid=332653
    >
    >


  6. #6
    Dave Peterson
    Guest

    Re: Replace using wildcards

    Any chance these strings are in one column?

    If yes, you could apply Data|Filter|autofilter to that column.
    Filter using Custom
    contains type=simple

    and then do your edit|replace.

    (heck, with just a few columns, it wouldn't be too difficult to do a few times)

    jeb wrote:
    >
    > Hi,
    > I'm a newbie to Excel and this group so please excuse my ignorance.
    >
    > I'm trying to do what should be a pretty simple find and replace. I want to
    > replace:
    > base=xyz*cntry=123*type=simple
    > wist
    > base=differentbase*cntry=123*type=simple
    >
    > I have to include the type field in my search and the asterik's are part of
    > the text, not wildcards. The only thing I want to change is the base.
    > I put this in for the search criteria:
    > base=xyz*cnty=???*type=simple
    > This finds all the lines I'm looking for so, so far, so good.
    > For the replace string, I use this:
    > base=differentbase*cntry=???*type=simple
    >
    > The result is that it changes all the cntry='s to ??? instead of just
    > leaving them alone.
    >
    > Any suggestions appreciated.


    --

    Dave Peterson

  7. #7
    jeb
    Guest

    Re: Replace using wildcards

    Thanks Dave! That's what I needed.

    John

    "Dave Peterson" wrote:

    > Any chance these strings are in one column?
    >
    > If yes, you could apply Data|Filter|autofilter to that column.
    > Filter using Custom
    > contains type=simple
    >
    > and then do your edit|replace.
    >
    > (heck, with just a few columns, it wouldn't be too difficult to do a few times)



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1