Data360 Analyze

Welcome to the Data360 Analyze community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  Issues extracting text within a string

    Employee
    Posted 11-30-2017 09:00

    Hi,

    I'm currently working on a project whereby one test I have to do involves extracting text from within a string. Using python or BrainScript I am noticing that commands such as "left", "right" and "substr" are not going purple in the new "Transform" node, but will in the superseded node. I get the following error:

    NameError: name 'left' is not defined Error executing "ProcessRecords" at line "15"

    when using the code:

    out1.IAG_Test1_Step3 = left(out1.IAG_Test1_Step1,3)

     

    Any help on this would be greatly appreciated, thanks!

    Alex



  • 2.  RE: Issues extracting text within a string

    Posted 11-30-2017 09:45

    python uses the syntax

    out1.IAG_Test1_Step3 = out1.IAG_Test1_Step1[:3]

     

    https://docs.python.org/2/library/string.html



  • 3.  RE: Issues extracting text within a string

    Employee
    Posted 11-30-2017 09:50

    Hi, 

    Thanks for your quick response. I'm now encountering:

    no viable alternative at input ';' Error in "ProcessRecords" at line "6", column "44" in text: out1.IAG_Test1_Step3 = out1.IAG_Test1_Step1[;3]

    The 3 does go green though so it seems like it's working? Test1_Step1 is a string field too.

    Thanks,

    Alex



  • 4.  RE: Issues extracting text within a string

    Posted 11-30-2017 10:07

    My bad.. it was supposed to be a colon, not a semicolon. I've corrected it above

     



  • 5.  RE: Issues extracting text within a string

    Employee
    Posted 11-30-2017 10:08

    Thanks, I saw that and now I'm all sorted!