Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Text Input step to configure based on dynamic fields

  1. #1
    Join Date
    May 2011
    Posts
    24

    Default Text Input step to configure based on dynamic fields

    Hello,

    I am using a Text input step to read in fields and then map them to a table output using a select values step. The problem is that the fields that come in the text input step is dynamic. But there is a constant number of fields that always would be required for the select values step. Is there a way to read in the requisite number of constant fields and reject the remaining dynamic number of fields. For eg my required fields for the Select values step are a,b,c. But the text file might contain (a,b,c,d,e,f,g) or (a,b,c) or(a,b,c,d). I just need to read in a,b,c from the text file. Suggestions and guidance would very much helpful. Thanks a lot.

  2. #2
    Join Date
    May 2011
    Posts
    24

    Default

    I am using Pentaho 4.2.0

  3. #3
    Join Date
    Aug 2008
    Posts
    563

    Default

    You can already define in the csv input step only the first 3 fields ... then it will only import the first 3 fields. This only works if they are the first 3 fields. So if your file has a,b,c,d,e,f -> you only define a,b,c to be imported.
    Best regards,
    Diethard
    ===============
    Visit my Pentaho blog which offers some tutorials mainly on Kettle, Report Designer and Mondrian
    ===============

  4. #4
    Join Date
    May 2011
    Posts
    24

    Default

    Hello Diddy,

    The problem is that they would not always be the first three columns of the input file. It could also come in the format of (d,a,e,b,c) etc

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

    Default

    For these non-standard text files it makes sense to simply read the whole line.
    You can then for example split the field to rows generating a bunch of key/value pairs that you can then de-normalize again if you like.
    Depending on the situation you can also pick a marker field to switch/case on and then send the data to various Split fields steps.
    Finally, if the data is hierarchical in nature you might have to work a combination of all possibly with some JavaScript ;-)

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.