5 Replies Latest reply on Dec 22, 2009 12:24 PM by JoeTaureau

    Find

    JoeTaureau

      Title

      Find & Replace on specific fields ?

      Post

      Hi there !

       

      I've found a way to do a global Find&Replace and all was well, until my boss asked me to do this on SPECIFIC fields, so now i'm clueless.

       

      Let's say i have 6 fields :

       

      Field1

      Field2

      Field3

      Field4

      Field5

      Field6

       

      ... and i want to do a global Find&Replace of let's say (carriage return) by "; "only on Field1, Field3 and Field5.

       

      How would one proceed with such request ? I'm pretty sure the answer is simple enough, but for the life of me, i just can't find anything about it on this very forum and my Google-fu is weak.

       

      Replace Field Content ?

      Substitute ?

      Perform Find/Replace ?

       

      Halp ?

        • 1. Re: Find & Replace on specific fields ?
          philmodjunk
            

          Is it allways the same specified fields?

           

          If so, you could create a second layout that just has those fields. You could switch to this layout, perform the find/replace and then switch back.

           

          If the user specifies different fields each time, you'll probably need to script this instead.

          • 2. Re: Find & Replace on specific fields ?
            JoeTaureau
              

            Ok, i've found a partial way of doing this. Script with Replace Field Contents with a Calc :

             

             

            Substitute ( test::English; "¶" ; "; " )

             

            ... but again, i still have the same problem as in my other thread. When i put this in the second "Specify" button, it doesn't do anything and when i put it in the first "Specify" (the one beside "specify target field"), i always have the poup window with the 3 choices (Replace with, Replace with Serial Numbers, Replace with Calc), and it actually works if i shoot him the calc manually in the 3rd option.

             

             

            • 3. Re: Find & Replace on specific fields ?
              JoeTaureau
                

              PhilModJunk wrote:

              Is it allways the same specified fields?

               

              If so, you could create a second layout that just has those fields. You could switch to this layout, perform the find/replace and then switch back.

               

              If the user specifies different fields each time, you'll probably need to script this instead.


               

              Ooohh clever ! Never thought of that ! :D

               

              And yes, it's always the same fields. I will give it a whirl, but i'd still like to know the answer to that popup problem in the post just above this one.


              • 4. Re: Find & Replace on specific fields ?
                philmodjunk
                  

                You need to use both specify buttons.

                 

                Click the first Specify button and select the field where you want to perform your replace field contents.

                Click the second Specify button, select "calculated result" and enter your calculation and click OK twice to return to the script editor.

                If you don't want the user to see this dialog when the script runs, clear the Perform without dialog check box on the bottom left.

                • 5. Re: Find & Replace on specific fields ?
                  JoeTaureau
                     Oh hell yeah ! Thanks dude, it's working ! :D