File operations

With EasyMorph you can perform common file operations in a fast, visual way using the "File command" action. As with other actions, this action's commands can be configured using parameters. As of now the following commands are available:

  • Copy/move file
  • Copy/move list of files
  • Rename/clone file
  • Rename list of files
  • Delete file
  • Delete list of files
  • Create folder
  • Clean folder
  • Delete folder
  • Zip file
  • Zip folder
  • Unzip archive

Notice that some commands deal with one file (or folder) while some operate with multiple files using lists of files. Let's take a close look at the difference between them.

Single file/folder operations

When a command operates with one file or folder, the file name(s) can be specified either explicitly or using a parameter. In the screenshot below, the "Copy/move file" command is configured using a file name explicitly (MyData .xlsx), and a folder path using a parameter (Target folder).

Operations with a list of files

Some of the commands above operate with a list of files. A list of files in this case is a column, which values are full file paths. It's a convenient way to manipulate multiple files at once without using iterations.

To use a file command with a list of files, the list has to be produced first. Most frequently, the list is produced using the "List of files" action, and then filtered using various filtering actions if necessary. In the screenshot below, the initial list of files is generated using the "List of files" action, and then filtered using two filtering actions. The first filter keeps only files with extensions ".xlsx" and the second keeps only files with numerical names, using an expression.

Once a required list of files is produced, use the necessary file command and specify the column that contains the list of files in the action's input dataset.

Watch a similar video in
Example: a project that deletes all .PDF files from the user's desktop: clean-desktop.morph.

Advanced topics

File operations with remote locations

While the "File command" action described above is intended for operations with local files and folders, you can perform similar operations with remote locations in popular cloud and file services. Currently, EasyMorph supports remote locations in the following:

Manipulating files and folders in remote locations requires creating a connector to the respective service. After the necessary connector is created, use the relevant action from the "Workflow" category to perform the necessary operation.

Note that EasyMorph can't import files directly from remote locations. Files need to be downloaded to your local machine before importing them in EasyMorph. Use one of the actions above to download files before importing.