Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hello,

    I would like MS Word 2007 to Find and Replace (CTRL H) the following:

    FROM: A:0001

    TO: A:0001-01

    The -01 will never increment and always stay at -01

    I cannot get MS Word to pick up after the A:0 (using the A:***).

    My number range is from A:0001 to A:0600

    Your thoughts are appreciated.

    Jim

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='jamesm067' post='791876' date='02-Sep-2009 14:14']I cannot get MS Word to pick up after the A:0 (using the A:***).

    My number range is from A:0001 to A:0600[/quote]
    Word's syntax for wildcard searches is a bit obscure. Try these strings:

    Code:
    Find what: A:0[0-9]{3}
    That will match A:0 followed by exactly 3 numeric digits

    Code:
    Replace with: ^&-01
    That will tack on -01 (it's not smart, so if you run it a second time, you will get -01-01).

    Any luck?

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    [quote name='jscher2000' post='791885' date='02-Sep-2009 23:10']...
    That will tack on -01 (it's not smart, so if you run it a second time, you will get -01-01).
    ...[/quote]
    You could make it smarter by using
    (A:0[0-9]{3})([!-])
    as the search string, and
    \1-01
    as the replace string.

    The syntax for the find string is
    ()() - divides the string into two parts. The first part is identical to Jefferson's. The second part is any character that is NOT -
    The syntax for the replace string is \1 (the first part of the find string) followed by -01

Posting Permissions

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