2 Replies Latest reply on May 12, 2015 7:01 AM by philmodjunk

    change order of words?

    ShelleyKuther

      Title

      change order of words?

      Post

      I have one field with over 400 names entered by last name first---Smith, John.  Is there a way to change the order of the words so that they would read John Smith instead of Smith, John?  I've checked the knowledge base etc, but I can't find anything that seems to answer this question.  Thank you.

        • 1. Re: change order of words?
          raybaudi

          If the comma's position is consistent ( always after the last names ) and if you are speaking of 400 records, each one containing a field with lastname and firstname, you could use this calculation:

          Let([
          T = yourNameField ;
          p = Position ( T ; "," ; 1 ; 1 ) ;
          LastName = Trim ( Middle ( T ; 1 ; p - 1 ) ) ;
          FirstName = Trim ( Middle ( T ; p + 1 ; Length ( T ) ) )
          ];
          FirstName & " " & LastName
          )

          • 2. Re: change order of words?
            philmodjunk

            I have one field with over 400 names entered

            That sounds like data better stored as a set of over 400 related records with one record for each name as raybaudi has commented. But if you truly have this all in one large field, a looping script could use a modified version of his calculation to re-order the names in each row of text.