Results 1 to 3 of 3

Thread: Find the word in the lsit

  1. #1

    Default Find the word in the lsit

    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. #2
    Lavastorm Employee stonysmith's Avatar
    Join Date
    Nov 2006
    Location
    Grapevine Tx
    Posts
    799

    Default

    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. #3

    Default

    Boom!!! Exactly what I was looking for.

    Thanks Smith Appreciate your quick reply.

    Thanks
    GK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •