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.  Expand row into columns

    Employee
    Posted 09-23-2014 07:44

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

    Originally posted by: a_vaitsos

    I am stuck with a rather trivial problem. I have a row of data separated by commas and I want to expand each one into columns.
    For instance, my input is of the form:

    Data: string
    abcd,efgh,ijkl,mnop,qrst

    And the required result should be in the form:

    Counter: intger, Data:string
    1, adcd
    2, efgh
    3, ijkl
    4, mnop
    5, qrst

    Can someone help me with this?

    Thanks,

    Alex


  • 2.  RE: Expand row into columns

    Employee
    Posted 09-23-2014 08:54

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

    Originally posted by: stonysmith

    In a filter node:



    output 1 {
    emit long(0) as RowSource
    emit long(0) as Counter
    emit "" as Data
    where false
    }

    i=0
    s=split('Data',",")
    while (i < len(s)){
    do output 1 {
    emit execCount as RowSource
    emit i+1 as Counter
    emit s[i] as Data
    }
    i=i+1
    }


  • 3.  RE: Expand row into columns

    Employee
    Posted 09-23-2014 09:02

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

    Originally posted by: a_vaitsos

    Thank you,

    This works great.