The Spotfire Community is moving to TIBCOmmunity and this forum location has closed. During the transition, you can still search the old forums but posting has been disabled. We encourage you to pick up the discussion at the new Spotfire community on TIBCOmmunity.
Extracting names from a text column - TIBCO Spotfire Community

Extracting names from a text column

Last post Sun, Jun 3 2012 3:15 PM by Christof. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Thu, May 24 2012 6:42 AM

    • kdawg
    • Top 500 Contributor
    • Joined on Wed, Aug 24 2011
    • Posts 6

    Extracting names from a text column

    I am working with a dataset that has a text column that should appear as below:

    *X Smith,John, 123456, 11-DEC-10.

    Unfortunately it sometimes is formatted incorrectly and appears like this:

    *X SmithJohn 123456 11-DEC-10

    In either case, I need to extract the full name, John Smith, from the data.

    When the data is correctly formatted, it is no problem.  But I haven't found a solution for the second case.  Any suggestions?

     

    thanks,

    Kevin

  • Sun, Jun 3 2012 3:15 PM In reply to

    Re: Extracting names from a text column

    You should work with the spaces to cut the string into pieces.

    Find(" ",[NameCol]) gives you the first space in the text.

    Work work with expressions like :

     mid([NameCol],find(" ",[NameCol],99)+1) to cut off everything before the first Space.

    You can handle multiple exeptions by usin the  "case when" statement.

     

    I order to separate the name string at the seconf uppercase letter in the string you should be able to use a Regular Expression.

     

    If you struggle, let me know and we can try to fix it here in the forum.

     

    Chirstof

    -----------------------------------
    Dr. Christof Gaenzler
    Sr Solutions Consultant
    TIBCO Spotfire
Page 1 of 1 (2 items)
©Copyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center