Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Sep 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Modifying a word document (MS Word 2000)

    I have a long word document with a lot of places were a number shows up. The format of that number is always xx.xx. It is really intended to be dollars and cents, but the $ sign is not in place in front of the numbers. I am looking for a way to add all the $ signs without going through it item by item. I figured out how to use wildcards to search and find each occurrence. But, I can't figure out how to tell it to replace that occurrence with the same numbers preceeded by the $ sign. When I use the wild cards in the "replace" part of the find/replace, the wild cards themselves show in the document. Can anyone give me a suggestion please to salvage my weekend and prevent me from having to go through this by hand? I would be so grateful

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Modifying a word document (MS Word 2000)

    Welcome to the lounge.

    Find What: ^#^#.^#^#
    Replace With: $^&

    Should do what you want.

    StuartR

  3. #3
    New Lounger
    Join Date
    Sep 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modifying a word document (MS Word 2000)

    That is remarkable. Thank you very, very much.

    Can you please help me further? As I get into the document, I find there are also places where the numbers are xxx.xx and xxxx.xx. So, in these cases, it puts the $ sign in the wrong place. I understand that I did not define the problem clearly in my earlier post, having not looked far enough through the document. Sorry. So, is it possible to modify what I put in the find/replace boxes to cover this as well?

    The other odd thing that is happening is that on the line of type where the number appears and the $ sign is being added, as it adds the $ sign, it indents the whole line of type - sometimes about 15 spaces and other times about 20 spaces. Any clue?

    How do you learn these things? I know there is so much more that the software can do, but am lost at figuring out how to learn.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Modifying a word document (MS Word 2000)

    <P ID="edit" class=small>(Edited by jscher2000 on 24-Sep-05 10:48. See note in blue.)</P>Find and Replace is somewhat mysterious. If you expand the dialog and explore the Special button, you will see lots of handy codes. Note that the codes are different depending on whether your insertion point is in the Find what or Replace with box. And also if you have Use wildcards ticked. So there are four possible lists. And there may be secret options that are listed only in the help or at Microsoft.com or in books or on the web... I think the bottom line is that you can't really learn all of the possibilities, but you need to know where to start exploring. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    With respect to numbers of different length (2+ digits), you may have to use wildcard searching. If you turn on Use wildcards, then you can try something like this:

    Find what: [0-9]{2,3}.[0-9]{2}
    <font color=blue>Note: the {2,3} means 2 to 3 of the characters in the brackets; to match 2 or more, use {2,}</font color=blue>

    If you test by clicking Find next, you will see that it work up to a point: when it reaches a number like 299.99, it matches the entire number, and then it matches again on 99.99, which is going to insert $ into the middle of the number. So... how about if we require a space at the beginning of the Find what text? Okay, this finds the number correctly, but then the $ will have a space after it, so we have to make another refinement, by grouping different parts of the find text together:

    Find what: ( )([0-9]{2,3}.[0-9]{2})
    Replace with: 1$2

    Each part in parentheses becomes its own Find what expression, and because ^& can't differentiate, you use a 1 for the first, a 2 for the second, etc. This positions the $ where it needs to be.

    Now: what if you get up to 4 digits and you want to recognize or insert a comma?! I'll leave that one for the experts. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    Finally, with respect to formatting, first make sure that your Replace with box doesn't list any funny formatting right below the text (for example, Font: Bold or Style: Heading 1). If it does, click in that box and use the No Formatting button to clear it. If that doesn't help, maybe some kind of AutoFormatting is taking hold. Under Tools>AutoCorrect Options..., AutoFormat As You Type tab, see if there is anything you can turn off that will help.

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modifying a word document (MS Word 2000)

    One way to catch all numbers that have decimal points is:

    Using wildcards:
    Find: ([0-9]{1,}.[0-9]{2})
    Replace: $1

    That will find all numbers that have one or more digits before the decimal point & exactly 2 after. The parenthesis groups them as a unit, so you can refer to this group as 1 in the replace box. Then your replacing your found expression with a $ sign in front. Robin Trew wrote a tremendous explanation of using Find & Replace. He gave me permission to incorporate it into what I have written & collected. I have it stored on http://www.znail.com, but haven't figured a way to let others download it without giving up my password. <img src=/S/confused.gif border=0 alt=confused width=15 height=20> When I do, I'll try to make it available.

  6. #6
    New Lounger
    Join Date
    Sep 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modifying a word document (MS Word 2000)

    You guys are great and have solved my problem. Thank you very, very much - and have a great weekend. Now, I can enjoy my weekend as well. I truly do appreciate the help. [img]/forums/images/smilies/smile.gif[/img]

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modifying a word document (MS Word 2000)

    > How do you learn these things? I know there is so much more that the software can do, but am lost at figuring out how to learn.

    As Jefferson indicated, it's a whole new world out there, when it comes to Search and Replace. The richness and diversity comes from the use of "regular expressions", which have been aptly described as "as wildcards on steroids" at Regular-Expressions.info. Microsoft have utilized (their own version of) the concept in their own software. You can get a bit of a taste for it from these articles:
    Microsoft Office Assistance: Add power to Word searches with regular expressions
    Microsoft Office Assistance: Putting regular expressions to work in Word

    Alan

Posting Permissions

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