4 Replies Latest reply on Mar 31, 2015 10:40 AM by samarthmkt

    Replace Contents

    samarthmkt

      Title

      Replace Contents

      Post

      Dear Friend,

      Is there any script to replace the first four character from data field. It may be first single character either first two character or first three character. The character may be text or numeric or numeric sign.

      Thanks

        • 1. Re: Replace Contents
          philmodjunk

          FileMaker has quite a set of text functions that can be used to parse and manipulate text--both text in fields and also in variables. There is even a replace function that you can look up in FileMaker Help.

          Can you provide an example of how you want this to work?

          • 2. Re: Replace Contents
            samarthmkt

            Thanks for Reply

            Though i have got a list of mobile phone contacts. In contacts some no. starts with 0 code, some no. starts with 00code ,some  no. starts with +91(Country Code). and some no are without any code. So i want to convert all contacts mobile phone into country code (+9!). For example  i want to replace or convert                        09758645897 to +919758645897

                                                                                                                009758645897 to +919758645897

                                                                                                                9758645897 to +919758645897

            • 3. Re: Replace Contents
              philmodjunk

              It would appear then that all your phone numbers are from 10 to 12 digits long and you always want the right 10 characters, but with +91 appended to the beginning.

              If so, then this calculation (not a script) will do it:

              "+91" & Right ( PhoneNumberFieldHere ; 10 )

              This can be part of the definition for a calculation field, an auo-enter calculaiton on the phone number field or used in a script with either the Set Field (to modify this value in a single record) or Replace Field Contents (To modify all records in the current found set).

              Replace Field Contents is also a menu option so you can manually set up a found set and use this option to update all of the records in one "batch" update manually as well as via a script.

              1 of 1 people found this helpful
              • 4. Re: Replace Contents
                samarthmkt

                Thanks for your valuable answer