PDA

View Full Version : File location.... Feature enhancement request



kettle_anonymous
02-21-2006, 05:48 AM
Hi,
I have problem with the text file input or output:
the location is 'hardcoded' in the ktr file.
Is there a way to have a new 'variable' wich represent the path of the ktr file.
So I can give relative(to the ktr) path to my data files!


If the night are a bit long... perhaps some can work on this idea : attach a propertie file to a .ktr (transormation properties) file where we can had our proper variables ...



Best regards
ppa

MattCasters
02-21-2006, 11:03 AM
Hi,

The nights are long indeed.
You *can* pass an evironment variable to the Kettle program at hand by modifying the launching script.
Add option -DVAR=C:\PATH\TO\FILE

In Text file input or output you can then use %%VAR%%. There is a tooltip showing the translated value.

We're thinking on adding an option to have an XML file loaded that sets any number of variables.
Any other thoughts and suggestions are welcome too!

Take care,
Matt

kettle_wconroy
03-23-2006, 05:26 AM
We have a transformation that starts with a file as well. We dont care about the name, just that it is in a certain format. We have a chef processes that checks for existance of a file, then invokes the transformation. Ideally, we would like to just have to put the file name in the existance check and have it passed to the transformation. Is there any current way to do this? If not, I would love to see this implemented in future versions.

Thanks.

Bo

MattCasters
03-23-2006, 05:38 AM
Hi again,

I'm thinking of adding a For-Each button in the Job job entry.
For every file-name in the input, execute the job.
Same for the Transformation job entry.

Then all that's needed to complete the picture is have a "File info" step that gives you back information on the filesystem, like list of files with a certain wildcard.
I can re-use the GUI from text file input for that.

Also, I'm adding a step in the near future that will allow you to set environment variables based on an input stream.

The full thing then becomes in a job:
- transformation that gets the files in a directory, send to result rows
- for each result row, execute a job/transformation
- transformation: set environment variable
- read the text-file as defined in the environment variable (already exists)
- process the data ...

Anything else I missed? I like this because the work to do is minimal and the effect is maximal: eliminate shell scripting that is still needed at present time.

Kind regards,
Matt