Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: Getting the file name in run time dynamically from the input excel

  1. #1
    Join Date
    Nov 2015
    Posts
    5

    Question Getting the file name in run time dynamically from the input excel

    Hi,

    The following is my job


    I wanted to get these constants which are manually given to be dynamically updated in the fields. For run_date we have get system info and we can insert the system date into the RUN_DATE column. The problem is with the file name, I am in search of a step which would read the file name and put the value into filename column dynamically rather than entering it manually on every run when we change the file name. I have tried the steps like get file name, get file name in result etc.., But it didn't help. Is there any other step .. which could do it.. ?


    Thanks in advance,
    Asha Bidiyasar
    Last edited by ashe; 11-18-2015 at 01:54 AM. Reason: adding image

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    You could either use Get System Info and use arguments (less common method), or you could use parameters, and specify them when you run kitchen by adding "-param:filename=/path/to/file" to your command.

  3. #3
    Join Date
    Nov 2015
    Posts
    5

    Default

    Thanks Gutlez,

    It worked with parameter but.. here again we need to add the value.. which already add constant step was doing..

  4. #4
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Sorry... My response made sense based on what I read of your post when I responded.. But doesn't now.

    Which output step are you looking at?
    Some of the output steps will allow you to change the filename dynamically with the date included in the filename.
    Some of the output steps will let you specify the filename in the data stream.

  5. #5
    Join Date
    Nov 2015
    Posts
    5

    Default

    I am looking for step which would include filename dynamically into the column of the output table.

    Like we insert the system date into the columns like add_date and Update_date (audit columns) .

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You want to read a file without specifying the filename?
    Then your file must be found in a certain folder.
    With Text-File-Input you can use (regular) wildcard expressions to filter the files in that folder.
    And you can enable option "Include filename in output" on the "Content" settings page.
    Also there are a couple of fields you can enable on the "Additional output fields" settings page.
    So long, and thanks for all the fish.

  7. #7
    Join Date
    Nov 2015
    Posts
    5

    Default

    Quote Originally Posted by ashe View Post
    I am looking for step which would include filename dynamically into the column of the output table.

    Like we insert the system date into the columns like add_date and Update_date (audit columns) .
    I have a input step with an excel.. i specify the path there and read that file as input. I just want the filename ... for example: 2015xxx.csv is file name. I need "2015xxx" as value needs to be inserted in the output table(which is the output step) in a column with name filename for every record it is pushingg into the output table.

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

    Default

    Check the step:
    http://wiki.pentaho.com/display/EAI/...ooks+%28ODS%29

    Additional Output Fields tab: Short filename field
    -- Mick --

  9. #9
    Join Date
    Nov 2015
    Posts
    5

    Default

    Thanks... User(Mick_data)... This was the Solution I was looking for

Tags for this Thread

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.