1

Using Get File Names component in kettle (Pentaho Data Integration), I'm trying to get all files names (regardless of extension) from a folder which name come from a previous step's filed, let's say folderName.

I'm not getting any content from the given folder unless when specifying a static folder with a wildcard.

What I want is to add "Switch\ Case" component after "Get all files names" component which, depending on extension of a file, will redirect to the correct step.

Get files Names configuration illustration

Helping Hand..
  • 2,430
  • 4
  • 32
  • 52
mokolop
  • 11
  • 1
  • 3
  • What is the issue: (a) that you do not get any content or (b) that the `Switch/Case` is not working as you want ? – AlainD Apr 17 '18 at 09:56
  • I don't get any content from the "Get files names" component. – mokolop Apr 17 '18 at 14:13
  • The `Switch/Case` check for exact match of strings, while `Filter rows` allows to match contains, starts-With and ends-with matching. Sometimes writing a series of 3-6 `Filters rows` is better than writing a `Switch/Case` with 60 cases. – AlainD Apr 17 '18 at 16:35

1 Answers1

1

I assume you are on you machine. For a distant server the process is almost the same.

  1. Do NOT check the File name is defined in a field [nicely translated in Nom fichier depuis champ].
  2. The File or Directory becomes editable, and you may press the Browse button on the right.
  3. Select any file contained in the directory you want.
  4. Press the Add button. This feeds the Select files table. Warning: Most of the time, this step is forgotten!
  5. Press the Show filename(s) button at the bottom of the table. At this stage, you probably get only one file instead of the full directory.
  6. Edit the File/Directory column and erase the character at the right of the rightmost \ [or / on linux], so that this column contains the directory name and not the filename. Put .* in the Wildcard (RegExp) column.
  7. Check the Show filename(s) buton.
  8. Repeat variant of step 6 until you have what you want.
AlainD
  • 6,187
  • 3
  • 17
  • 31