1 Reply Latest reply on Nov 10, 2011 1:18 PM by Mary Posner

    GREP STYLE, find/change

    Kirikokos

      Hi!

       

      My problem is..

       

      I got these numbers:

       

      17

      31.9

      32.9

      15

       

      in a table/cells. They need to have an .00 and 0 like this:

      17.00

      31.90

      32.90

      15.00

       

      I can use this one for that: find: .$  change: $0.00 but then the numbers with 31.9 gets the .00 also.. 31.9.00

      Any grep styles for that? multiple functions in the same style`?

      Untitled-1.jpg

        • 1. Re: GREP STYLE, find/change
          Mary Posner Level 3

          A grep style can't change text for you; it can only apply a style to text that matches whatever pattern you set.

           

          I don't think there any one search/replace that will get you where you want to go, but I was able to do it using two search and replace strings:

           

          ^\d+(?!\.)\b

          $0.00

           

          Finds any number of digits at the beginning of a line, that does NOT have a period following it, and returns the same number with ".00" appended.

           

          ^\d+\.\d\b

          $00

           

          Finds the remaining instances that have a period and only one digit after it, replaces it with the found text with "0" appended.

           

          This will not touch anything that has a number that has two digits after the period, like 12.95.

           

          Give it a try on a copy of your document, see if it does what you need. Depending on how your document is set up, and what other text is in it, you might also want to highlight the table (or just the relevant columns) and restrict the search to the selection rather than the whole document.