Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: CSV file generation based on field value from INPUTDATA

  1. #1

    Default CSV file generation based on field value from INPUTDATA

    Dear All,

    Can someone help me what is the best way to do the following task:

    Input.CSV:
    sno supplier Tags
    1 A
    2 B Paris
    3 C Hamburg, Munich
    4 D Barcelona
    5 E Paris
    6 F Barcelona

    Depending on the TAGS Value I have to create different CSV files.
    MASTER.CSV : This should contain all rows where TAGS value is empty. Here Row with SNO1.
    sno supplier Tags
    1 A

    Paris.CSV: This should contain all rows where TAGS value is Paris. Here Rows with sno2 and 5.
    sno supplier Tags
    2 B Paris
    5 E Paris

    Can someone help me what is the best ways to implement this scenario?

    Regards,
    Rama

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    I would look at the Switch case step or you can even create a Text file using an entry from a field.
    Have a look at the option: Accept file name from field?
    -- Mick --

  3. #3

    Default

    hi Mick,

    I am not able to do that with both options:

    with switch the Problem is:

    3 C Hamburg, Munich

    The above row only appears in Hamburg.csv and not in munich.csv. I want that row to appear in both Hamburg.csv and also munich.csv files.

    with the a Text file using an entry from a field, I tried a bit but still not able to achieve the results.

    can you kindly provide more details or options?

    regards,
    Rama

  4. #4
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Oh, I see.
    Then first you have to split that field in 2 columns (or more) and normalise the data (Row Normaliser step: http://wiki.pentaho.com/display/EAI/Row+Normaliser).
    Then use either method that I suggested.

    Note that there are books available which explain this process with screenshots and data samples as well - have a look at the sticky posts
    -- Mick --

  5. #5
    Join Date
    Jan 2016
    Posts
    2

    Default

    Use Filter Row, and create a file ..

  6. #6
    Join Date
    Aug 2011
    Posts
    360

    Default

    Quote Originally Posted by Mick_data View Post
    Oh, I see.
    Then first you have to split that field in 2 columns (or more) and normalise the data (Row Normaliser step: http://wiki.pentaho.com/display/EAI/Row+Normaliser).
    Then use either method that I suggested.

    Note that there are books available which explain this process with screenshots and data samples as well - have a look at the sticky posts
    I would rather use split field to row, such that there is one row per tag.
    Then you should handle possible duplicates, trim the field, and build a file name base on tag field.
    Then use this filename in text file output woth accept filename from field

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.