LAE

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

Discussions

Members

Resources

Events

 View Only
  • 1.  Find the word in the lsit

    Employee
    Posted 10-27-2014 07:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: gauravdb

    hi Guys,

    can you please help me with this:

    mydata:string
    (1,2,3,4,5,6,7,8,9)

    What script should I use in filter node if I want to output the 4th character, which is "4" in this case ?? (Comma is delimiter and the search should not show this as a character). Tried using sub String operation but its finding Comma...

    Thanks
    GK


  • 2.  RE: Find the word in the lsit

    Employee
    Posted 10-27-2014 07:52

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Myself, I would use this:

    x="(1,2,3,4,5,6,7,8,9)" # put the text in a string
    s=x.replace("(","").replace(")","") #remove parenthesis
    t=s.split(",") # split by commas
    emit t[3] as MyValue #lists start indexing at 0 - [3] is the 4th element


  • 3.  RE: Find the word in the lsit

    Employee
    Posted 10-27-2014 08:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: gauravdb

    Boom!!! Exactly what I was looking for.

    Thanks Smith Appreciate your quick reply.

    Thanks
    GK