Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Splitting file data into rows

  1. #1
    Join Date
    Nov 1999
    Posts
    9,729

    Default Splitting file data into rows

    (Edited: posted by Anonymous in Wiki format, changed to plain text)

    I have a data file in the following format:

    EmpId
    Year1
    Salary1
    Year2
    Salary2
    Year3
    Salary3
    ...

    I would like to split the data into rows of a table
    EmpId Year1 Salary1
    EmpId Year2 Salary2
    EmpId Year3 Salary3
    ....

    How do I do it ?

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default RE: Splitting file data into rows

    Last week I created the Flattener step to do this ;-)

    Grab the last kettle.jar to try it out.
    (!! Java 1.5 required at the moment due to build problems on Javaforge)

    If you want to "Flatten" 7 consequetive rows, specify the names of these rows.
    You will get:

    EmpId Year1 Salary1 Year2 Salary2 Year3 Salary3

    After that, you can normalize this data using Normalizer to this format:

    EmpID, 1, Year, Salary
    EmpID, 2, Year, Salary
    EmpID, 3, Year, Salary

    Please check out the Spoon-2.2.pdf doc to find examples on how to do this.
    It's not that hard to do.

    All the best,

    Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.