Get File size in PDI

163 views Asked by At

I have an requirement to copy files from one folder and move it to other folder. An excel file (details/config file) will have the list of files and path to be copied, while copying and moving have to get the file details like file size, file type. All file details copied has to be inserted to a table and files that could not be processed has to be updated in a source table that is a replica of the config excel file. I have only 1.5 months of experience in pentaho and a detailed explanation will be a good help In detail

  1. I have inserted all details like file name and path to a table.
  2. In a transformation/job I can get each row from the source table and I can copy all files from source folder to destination folder in one shot using copy file or process files.
  3. But could not find a right component to get the file size and type while processing this file movement.
1

There are 1 answers

0
Tatchai S. On

You can use the Get file names step to get information about each file like type, size, extension, etc. In the Get file names step you can specify the field containing each file's destination or use a wildcard to get the matched file in your desired directory. In your Process files step you can add Error Handling to manage a file that could not be processed like updating the source table.

example