4 Replies Latest reply on Feb 28, 2009 2:48 PM by koolaukid

    Find and replace won't find and replace

    koolaukid

      Title

      Find and replace won't find and replace

      Post

      I'm know this is probably a no brainer but I have struggled with this for hours, in desperation I ask this question.

       

      I'm trying to use the "Find and Replace" script step to find occurrences of " -" (a space and a hyphen) and replace it with "-" (hyphen) across all the records in the database.  Manually, I can go under the "Edit" menu, select "Find and Replace", enter the text to search for and the replacement text.  However when creating a script using the "Find and Replace" step, it won't allow me to just enter the text I'm looking for, nor will it allow me to enter the text I'm looking for surrounded by quotation marks.  How do I enter text to be searched for in the "Find and Replace" script step?

        • 1. Re: Find and replace won't find and replace
          TSGal

          koolaukid:

           

          Thank you for your post.

           

          In the Perform Find/Replace [] script step, click the "Specify..." button and a new dialog box appears.

           

          At the top, where it says "Perform", click on the pop-up to the right and change it from "Find Next" to "Replace All".

           

          For the "Find what:" area, enter:  " -"    (that is, quote-space-hyphen-quote)

           

          For the "Replace with:" area, enter:    "-"    (that is, quote-hyphen-quote)

           

          For the "Direction", select "All".

           

          The other options are up to you.  It sounds like you want to replace across all records and all fields.

           

          Click "OK" and save the script.

           

          Now, when you run the script, it will replace all instances of space-hyphen with hyphen.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Find and replace won't find and replace
            koolaukid
              

            TSGal,

            Thank you very much for your response.  I've been trying this exactly as you describe but it doesn't find nor replace.  This step is part of a script where I;

             

            Enter Browse Mode

            Perform Find (Restore)  which finds the subset of records I want to perform the find and replace operation on.

            Perform script(GoTo Data Entry) which is the single record view

            Go To Record/Request/Page [First]

            Perform Find/Replace[No dialog; " -"; "-"; Replace All]

             

            For the miscellaneous options, "match case" and "match whole words only" are unchecked, "Search Across" has "all records/requests selected and "Search Within" has "all fields" selected.

             

            The first four steps operate correctly, finding the set of records I want to correct, going to the corrrect layout, then the first record in the group, however it doesn't perform the Find/Replace.  Is there some sort of trigger to initiate this action?  I'm not sure where I am going wrong as I've followed your instructions, read the manual, scoured the forum but cannot seem to get this right.  Appreciate any help you might be able to provide.

            Scott

            • 3. Re: Find and replace won't find and replace
              TSGal

              koolaukid:

               

              Thank you for the clarification.

               

              I have set up a table, TEST, with the following fields:

               

              Field1 (Text)

              Field2 (Text)

              Field3 (Text)

               

              I have create five records with the following information:

               

              Field1 ; Field2 ; Field3

               

              This is a test - try again ; Second field ; X

              First field ; This is a second test - another hyphen ; X

              First field ; Second field - with hyphen ; Y

              First field ; Second field ; X

              First field - hyphen ; Second field - hyphen ; Y

               

              My script is as follows:

               

              Enter Browse Mode []

              Perform Find [ Restore ]    (that is, find for Field3="X" )

              Go to Record/Request/Page [First]

              Perform Find/Replace [ No dialog ; " - " ; "-" ; Replace All ]

               

              -----------

               

              I don't have your middle script to "Perform Script (Go to Data Entry) ", since I only have one layout.

               

              When I run the script, all of the space-hyphen-space characters are replaced with a hyphen in the three records found.

               

              Make sure your script is not halting during your "Perform Script".  That would make it look like nothing happened.  Or, duplicate this script, remove the "Perform Script", and launch the script from your Data Entry layout.

               

              TSGal

              FileMaker, Inc.

              • 4. Re: Find and replace won't find and replace
                koolaukid
                   k

                TS Gal,

                Thank you for your response.  I've played with this thing, rearranging, selecting different options, etc but cannot get the script to work.  However it does work if I take out the "Perform Find (Restore) " command which is what I've done.  So it finds and replaces but does this to the entire file instead of a select group.  

                 

                Nonetheless I wanted to thank you for your efforts, they were much appreciated.

                k