Jump to content


Photo

Split text string by underscore in Data Wizard - Transformation?


  • Please log in to reply
2 replies to this topic

#1 burgess.freeman@stjude.org

burgess.freeman@stjude.org

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 09 February 2018 - 05:51 PM

Have a column, Sample_Name, and want to split each name by the underscore, e.g. 12_brain, resulting in two columns - Subject = 12 and Matrix = brain. I've tried search in custom functions with DW and Transformation (i.e. search("_",Sample_Name,1), but it always returns -1. I would be okay even just taking the numbers to the left of the underscore, and ditching the rest. Any advice on this? Thanks,



#2 Ana Henry

Ana Henry

    Advanced Member

  • Val_Members
  • PipPipPip
  • 232 posts

Posted 09 February 2018 - 06:17 PM

Dear User,

There are several ways to accomplish this.  See attached phoenix project.  I can accomplish this with a data wizard with 4 steps.  Do not forget to map your variables if the names are not the same.

 

Hope this helps,

Ana Henry

Attached Files


Edited by Ana Henry, 09 February 2018 - 06:19 PM.


#3 burgess.freeman@stjude.org

burgess.freeman@stjude.org

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 09 February 2018 - 07:23 PM

Thanks Ana, this helps. I also had the syntax wrong.  Best, Burgess






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users