5 Replies Latest reply on Apr 16, 2012 8:37 AM by peter minneapolis

    Find and replace a combination of character formats

    NutTriooo

      Hello all,

       

      Is it possible to find and replace a combination of character formats.

      for example:

      Search for VA. The V in Arial and the A is Helvetica.

      Replace this in V Arial and A in Verdana.

       

      Regards.

        • 1. Re: Find and replace a combination of character formats
          Peter Spier Most Valuable Participant (Moderator)

          Ive been thinking about this, and I don't think it's possible. It certainly isn't doable in one step in Find/Change and I don't think it's doable at all because there is not, as far as I know, a way to use a lookahead or lookbehind to find formatting that is different from the formatting of the string you are trying to locate, and you can't find multiple formats in one step.

           

          You can certainly find a V followed by an A, and you can even find all Arial V followed by A, or Helvetica A preceded by V, but unless the formatting is restricted to JUST the VA combinations you are looking for you have a problem.  If you can fiund just those combinations, you could replace using formatted contents of the clipboard, but I don't see a way to be sure you are only finding the particular string you want.

           

          It might be scriptable, though...

          • 2. Re: Find and replace a combination of character formats
            NutTriooo Level 1

            This is how we do it at the moment.

             

            Peter Spier wrote:

            If you can fiund just those combinations, you could replace using formatted contents of the clipboard.

             

            Thanks for the answer.

            Would I ask it in scripting?

             

            Regards

            • 3. Re: Find and replace a combination of character formats
              [Jongware] Most Valuable Participant

              Create a new swatch and call it "Red".

              Find V in Arial, replace with character color "Red".

              Find A in Helvetica, replace with character color "Red".

              Replace "VA" in character color "Red" with something else (from the clipboard is fine).

              Delete swatch "Red" and replace with Black.

               

              A lot of work, certainly, but then again the OP seems to be mixing Arial, Helvetica and Verdana at will, so I guess that's the price to pay.

              • 4. Re: Find and replace a combination of character formats
                Peter Spier Most Valuable Participant (Moderator)

                See, you think more clearly than I do at 4:00 a.m.

                 

                I was convinced I would need to apply the character style only when the two letters are in sequence together, but obviously that's not the case.

                • 5. Re: Find and replace a combination of character formats
                  peter minneapolis Level 4

                  NutTriooo wrote:

                   

                  Hello all,

                   

                  Is it possible to find and replace a combination of character formats.

                  for example:

                  Search for VA. The V in Arial and the A is Helvetica.

                  Replace this in V Arial and A in Verdana.

                   

                  Regards.

                  If the letter pairs are always the same, change one manually, then copy to clipboard. Find whatever; in the change to pop-up menu under the "@" symbol, Other > Clipboard Contents Formatted.

                   

                   

                  HTH

                   

                   

                  Regards,

                   

                   

                  Peter

                  _______________________

                  Peter Gold

                  KnowHow ProServices