Chapter 4. File Management

In this chapter, we will cover:

  • Copying or moving one or more files
  • Deleting one or more files
  • Getting files from a remote server
  • Putting files on a remote server
  • Copying or moving a custom list of files
  • Deleting a custom list of files
  • Comparing files and folders
  • Working with ZIP files

Introduction

On many occasions, the development of Kettle jobs and transformations involves manipulation of files, such as reading or writing a file along with other manipulations. Look at this sample scenario, where you have to:

  • Get a file with orders from a remote server
  • Validate and load the orders into a database
  • Move the processed file to a designated folder
  • If a file with that name already exists, rename the older version
  • If the orders in the file are not valid, generate a log file with details of the errors and put that log file back on to the server for further review

In this situation besides reading and writing files, you also have to transfer, rename, and move them.

Copying, moving, deleting, and transferring files, list of files or directories are tasks not only needed for these situations, but in everyday life. It's common to have lot of files, which need to be organized in several ways, and for different purposes.

Kettle has a rich set of steps and job entries for doing this. However, you might get lost or frustrated trying to pick and then configure the option that suits your needs. The recipes in this chapter should help you with that task.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset