7 Replies Latest reply on Dec 18, 2014 2:36 AM by binu.alexander

    Removing string after word in  filemaker field

    binu.alexander

      Title

      Removing string after word in  filemaker field

      Post

      I have  list of  500,000 terms in a table . Some of them have  string of numbers after the trem e.g      term1  (001)

      trem2 (002)  and so on  .  I want to get rid of the stuff in parenthess.  How can I do that ?

       

      Binu

        • 1. Re: Removing string after word in  filemaker field
          philmodjunk

          FileMaker has a number of text functions that can be used to manipulate text. An exact example of the text to be manipulated would be very helpful.

          Is "Term1 (001)" all the text in the field? Or is this subset of all the characters in a given field?

          Once we have the correct parsing calculation set up, either a looping script, a calculation field or Replace Field Contents might be used to manipulate the text in all of the records in your table.

          • 2. Re: Removing string after word in  filemaker field
            binu.alexander

            The terms are like this :

            some have numbers in parenthesis , some have text in parenthesis.

            ABC  DEF  (110)

            BCD  EFG  (120)

            DEF  GHI JKL  (12)

            EFG (xyz)

            ABC (def)

             

            What I want is to delete the numbers (with  the parenthesis)  and  retain the text(  in the parenthesis)

            Binu

             

             

            • 3. Re: Removing string after word in  filemaker field
              philmodjunk

              The details are critical here. Are you showing all the data in a single field (with 5 rows of text in it) or the data from 5 different records (each row is a different record)?

              And in each row,  I only see one use of parenthesis and no numbers except those that are within parenthesis. Is that a valid observation?

              • 4. Re: Removing string after word in  filemaker field
                binu.alexander

                thanks PhilModJunk,

                these are data in a single field  , 5 different records                                                                                                                                    

                Record 1               ABC  DEF  (110)                                                                                                                                                                Record 2               BCD  EFG  (120)

                Record 3               DEF  GHI JKL  (12)

                Record 4              EFG (xyz)

                Record 5              ABC (def)

                What I want is to get rid of is   the numbers with the  parenthesis    ( shown in red)

                I want to retain the text with  the parenthesis . ( shown in green)

                hope i am clear now.

                Binu

                • 5. Re: Removing string after word in  filemaker field
                  philmodjunk

                  You didn't answer this question:

                  And in each row,  I only see one use of parenthesis and no numbers except those that are within parenthesis. Is that a valid observation?

                  My answer assumes that this is the case. The following method will not work if there are number characters found outside of the parenthesis and the presence of additional parenthesis characters will also cause the following method to fail. It also will fail if there are any other characters, such as a space or a - sign inside the parenthesis along with the numeric digits.

                  Let ( [ TextList = Substitute ( YourFieldHere ; ["(" ;¶ ] ; [")" ; ¶ ] ) ;
                             ParenChars = GetValue ( TextList ; 2 )
                           ];
                           If ( Filter ( ParenChars ; 9876543210 ) = Parenchars  ; GetValue ( TextList ; 1 ) ; YourFieldHere )
                        ) // Let

                  • 6. Re: Removing string after word in  filemaker field
                    raybaudi

                    Another approach could be:

                    Substitute ( Filter ( YourTextField ; KanjiNumeral ( YourTextField ) ) ; "()" ; "" )

                    but, as with Phil's calculation, there must be no digit into the un-parenthesis-ed part of the text field.

                    • 7. Re: Removing string after word in  filemaker field
                      binu.alexander

                       

                      Phil your idea gave me the desired result  . It preserves the numbers outside the parenthesis.

                      Ray yours removes the numbers outside the parenthesis   .         

                      Thank you guys!

                      This will save a LOT of my time smiley

                      Binu