Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • filename - the complete filename, including the path (/tmp/kettle/somefile.txt)
  • short_filename - only the filename, without the path (somefile.txt)
  • path - only the path (/tmp/kettle/)
  • type
  • exists
  • ishidden
  • isreadable
  • iswriteable
  • lastmodifiedtime
  • size
  • extension
  • uri
  • rooturi

Note: If you have no files then the step (and the transformation) do not abort. If you want to abort the transformation you could use a detect Empty Stream step with some logic (see attached example GetFileNamesAbortExample.ktr)

File tab

This tab defines the location of the files you want to retrieve filenames for. For more information about specifying file locations, see Selecting Files to read data from.The "Selecting Files to read data from" page referred to above doesnt appear to exist on this site (at least, I was unable to find it). In the absence of such a page, I'll point out that the "Wildcard" field does not take what you would normally use as a wildcard when doing directory listings in Unix or Windows (e.g. a * to represent all files). In fact, what you need to put in here is a regular expression, as understood by java.util.regex. So, for example, to get names of all files in a directory, you could use .+ in the Wildcard field. For full details of regular expression syntax, see http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.htmlsection "Selecting file using Regular Expressions" on the Text File Input step.

Example: You have a static directory of c:\temp where you expect files with an extension of .dat to be placed. Under file/directory you would specify c:\temp  and under Wildcard you would have a RegEx with something like .*\.dat$

Filters

The filters tab allows you to filter the retrieved file names based on:

...