I want to use variable in 'Generate rows' step in Pentaho. How can i use it. I want to give a file path in a 'Value' field but that should not be static so that i can pass this value into my csv input.
-
To give you a great answer, it might help us if you have a glance at [ask] if you haven't already. It might be also useful if you could provide a [mcve]. – Mat Sep 27 '18 at 14:36
2 Answers
I am not sure to understand your question (see @mat's comment), but as far as I can understand it, I wonder if you really need a Generate Rows
.
The CSV Input File
can read the file name
from a variable. If you look near this field you'll see a small 'S' in a blue diamond shape. It means that you can put a variable in it, in the format ${var_name}
.
This suppose that your variable is indeed a variable, as opposed to a field. You can get the list of variables by pressing on Ctrl+Space
on any input box near the 'S' in blue diamond shape. You can add a variable either in defining in a previous job, either in the parameter list [Right-click anywhere and select Parameters
], either by editing the kettle.properties
[on the top menu Edit
], either by specifying the variable value on the small panel that is presented to you each time you want to run a transformation.
With a Generate Rows
, you define a field
and there is no way to use a field for the filename in a CVS Input file
. You can however use a field in a Text file input
with the Accept file name from an other step
check box, and telling spoon from which step and from which field. If you use this step, specify on the Content
tab that the filetype
is CSV.

- 6,187
- 3
- 17
- 31