Results 1 to 3 of 3

Thread: Expand row into columns

  1. #1

    Default Expand row into columns

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

    Default

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

    Default

    Thank you,

    This works great.

Posting Permissions

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