Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Passed the csv file name as a command line parameter.

  1. #1

    Default Passed the csv file name as a command line parameter.

    Hello,

    Can you please let me know how to pass the csv input file name as a command line parameter.

    Steps I have done,



    1. In my script, I have created 1 parameter that accepts the CSV file name (test.csv) from the command line.
    2. And I have stored that parameter value in Get variable step and passed the get variable step to CSV file input.
    3. CSV file input passed to text output step.



    Issue 1: I need to specify the column name in the csv input step.

    Is there any way that csv input file steps automatically create the structure of the file that we passed as the parameter.(GetFields)

  2. #2
    Join Date
    Sep 2007
    Posts
    834

    Default

    command line argument or parameter? they are 2 different things.
    - If you use a command line arg., do as follows:
    Get System Info --> CSV file input
    - If you use a named parameter you don't have to get the variable. You just specify the name of the file with the variable syntax ${<var>}


    The csv step doesn't recognize the structure automatically. The only way you have for filling the grid (beside doing it manually) is by implementing metadata injection.

  3. #3

    Default

    Thanks Maria for your response.

    Can you please give me the example of issue1 that I encounter previously so I can refer and be trying to implement.

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

    Default

    Quote Originally Posted by tushartajane18@gmail.com View Post
    Issue 1: I need to specify the column name in the csv input step.

    Is there any way that csv input file steps automatically create the structure of the file that we passed as the parameter.(GetFields)
    Your issue is not stated as an issue, it's stated as a statement. The statement is correct. You need to specify the column names to the CSV input.

    To answer the question that you followed up with...
    You could consider MetaData Injection, but if you don't know the type of the columns, Injection won't help you much.

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.