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.  How to i find, then extract the string...Noob

    Employee
    Posted 05-06-2015 21:19

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

    Originally posted by: a7n

    Hello champs ....
    Noob questions here
    I have a column of values like the below

    Comment
    aacc 1-1111 abcd
    1-2222 xxaders
    aasdfe 1-5555
    1-6666 cco00 11 dkd
    zzzz 1-0000 1111

    What I want to do is extract the 1-XXXX string out of it.... now I have identified the records containing the 1-xxxx sequence but cant figure out the next step, Appreciate your help

    Code below
    emit *
    where Comment.strFindI("1-") >=0
    .
    .
    .
    lost after this .. please help


  • 2.  RE: How to i find, then extract the string...Noob

    Employee
    Posted 05-07-2015 05:33

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

    Originally posted by: aop

    If the length of the sequence is fixed (6 characters) you could use emit Comment.substr(Comment.strFindI("1-"),6) as Result


  • 3.  RE: How to i find, then extract the string...Noob

    Employee
    Posted 05-07-2015 14:20

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

    Originally posted by: a7n

    Originally posted by: aop
    					

    If the length of the sequence is fixed (6 characters) you could use emit Comment.substr(Comment.strFindI("1-"),6) as Result
    Thanks that would work.. but the column is string so i am guessing that offset is failing....

    "expected boolean value as parameter 1 to operator; got string"


  • 4.  RE: How to i find, then extract the string...Noob

    Employee
    Posted 05-07-2015 17:37

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

    Originally posted by: a7n

    Originally posted by: a7n
    					

    Thanks that would work.. but the column is string so i am guessing that offset is failing....

    "expected boolean value as parameter 1 to operator; got string"
    all good..... i was using "where"