Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Can Text File Input use header values instead of order?

  1. #1

    Default Can Text File Input use header values instead of order?

    I think the Text File Input transform reads a file, and using the field order to assign them to named fields. In other words, if I define the columns as "Name, Address, Phone", then the 3rd column is always named "Phone". Correct?

    Is there a feature where Pentaho can read the header line at run time, and throw an error if the header of the 3rd column is not Phone?

    Scenario:

    I have a case where sometimes the input file is delivered to me with columns:

    Name, Address, Phone
    and sometimes with columns
    Name, Address, Email, Phone
    I only need the Name and Phone columns, so I would like Text File Input to match fields to columns by using the header line, not positions. Is this possible?

  2. #2
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hey Bob,

    yes it can be done, not directly though. Maybe we should make this a feature.

    For the moment, the idea is to run a transformation up front that will look at the fields available and then fill in the correct fields in the main transformation dynamically.

    There are a couple of references where something like this is done:

    http://www.ibridge.be/?p=194
    http://type-exit.org/adventures-with...s-with-kettle/
    http://wiki.pentaho.com/display/EAI/...generic+job%29 (my favorite)

    I myself was facing a case once where the file would contain a few guaranteed fields and a few random ones. Sorted alphabetically by field name...

    Solved it using roland's approach in my case.

    Cheers
    Slawo

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.