Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: file name in fixed file input

  1. #1

    Default file name in fixed file input

    heeey guys ,

    i have a question, in fixed file input , i wanna to read input file name in the output of this step, so i checked the option Add file name to result,
    but actually it is not read ,

    is there any needed steps i need to do to include file name in the output inside that transofrmation ???

    waiting your replies and

    thanks in advance

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Documentation at http://wiki.pentaho.com/display/EAI/Fixed+File+Input

    "Add filename to result" will not add the filename to the output of the step itself. If "text file input" works for you can use that together with its version of "add filename to output"... which does what you assume

    Regards,
    Sven

  3. #3

    Default

    first thanks for your reply

    actually i read the documentation before my post , and i didn't understand what was meant in these lines

    Adds the filename(s) read to the result of this transformation. A unique list is being kept in memory that can be used in the next job entry in a job, for example in another transformation.



    i wana to get file name in the running transformation, how to do it

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    What you want is currently not built in in fixed file input. What it does when you check the "filename checkbox" on is that it puts the filename in the result of the transformation (it's not for use in the transformation itself).

    If you use text file input step (which an also process fixed width files) there you can use the option "add filename to output" which does what you want.

    Regards,
    Sven

  5. #5

    Default

    ahaaa, i didn't know they are similar

    soo what is the reason of fixed file input while it can be made through text file input ???

    and BIG thanks sboden

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    text file input was first, but over time "too much" functionality got included... it still works but it became pretty hard to change without breaking stuff. The other text input steps arrived afterwards as simpler versions with more specific usecases.

    Regards,
    Sven

  7. #7
    Join Date
    Jun 2007
    Posts
    476

    Default

    If I understand, what you want to have is:
    Code:
    Field1    Field2    Field3    Filename
    Actually, that is a real simple task to do, simply add a "Add Constant" step after your input in which you set the name manualy or if the name comes from a variable, you can add a "Get Variable" step in which you set the variable name and the name you want to give it for your stream.

    Is this of any help?? is your problem what I'm understanding??
    Rodrigo Haces
    TAM / Enterprise Architect
    Pentaho

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.