Saturday, March 14, 2015

How to use tFileProperties in Talend

tFileProperties obtains information about the main properties of a defined file
A schema is a row description, it defines the fields to be processed and passed on to the next component.
The schema of this component is read-only. It describes the main properties of the specified file. You can click the [...] button next to Edit schema to view the predefined schema which contains the following fields:
  • abs_path: the absolute path of the file.
  • dirname: the directory of the file.
  • basename: the name of the file.
  • mode_string: the access mode of the file, r and w for read and write permissions respectively.
  • size: the file size in bytes.
  • mtime: the timestamp indicating when the file was last modified, in milliseconds that have elapsed since the Unix epoch (00:00:00 UTC, Jan 1, 1970).
  • mtime_string: the date and time the file was last modified.
output_row.abs_path = input_row.abs_path;
output_row.dirname = input_row.dirname;
output_row.basename = input_row.basename;
output_row.mode_string = input_row.mode_string;
output_row.size = input_row.size;
output_row.mtime = input_row.mtime;
output_row.mtime_string = context.Timestamp;

Cheers!
Uma

No comments:

Post a Comment