User Tools

Site Tools


transformations:filecommand

FILE COMMAND

Category: Workflow / External


Description

This action can perform the following file operations:

  • Copy or move file, or list of files
  • Rename or clone file
  • Rename a list of files
  • Delete file or list of files
  • Create folder
  • Clean folder (deletes files and, optionally, subfolders)
  • Delete folder
  • Zip file
  • Zip folder
  • Unzip a file


Action settings

Setting Description
CommmandSelect the file/folder command to use. See the following tables for details of all commands.


Copy/move file settings

Description: Copies or moves a file to a new location. The filename is retained.

Settings Description
ModeSelect whether to create a copy of the selected file or move it. Options: Copy or Move.
File path*Enter or browse to the fully qualified path and filename of the source file.
Destination*Enter or browse to the folder to copy or move the file to.
If the file doesn't existSelect how EasyMorph will handle cases when the source file does not exist. Options: Do nothing or Halt project execution (the workflow stops processing and displays an error).
If a file with such name already existsSelect how EasyMorph will handle saving the file if a file with the same name exists in the destination folder. Options: Overwrite, Rename the existing file, or Halt project execution. See the "File already exists" table below.

* Setting can be specified using a parameter.


Copy/move list of files settings

Description: Copies or moves the files listed in a table column to another folder.

Settings Description
ModeSelect whether to create a copy of the source files or move them. Options: Copy or Move.
File pathsSelect the column containing the fully qualified paths and filenames of the files to be copied or moved.
Destination*Enter or browse to the folder to copy or move the files to.
If a file with such name already existsSelect how EasyMorph will handle saving the file if a file with the same name exists in the destination folder. Options: Overwrite, Rename the existing file, or Halt project execution. See the "File already exists" table below.

* Setting can be specified using a parameter.


Rename/clone file settings

Description: Renames or creates a copy of a file with a new name ("clone"). Cloned files are created in the same folder as the source files.

Settings Description
ModeSelect whether to rename the selected file or copy it with a new name ("clone"). Options: Rename or Clone.
File path*Enter or browse to the fully qualified path and filename of the source file.
New name*Enter the new name for the file.
If the file doesn't existSelect how EasyMorph will handle cases when the source file does not exist. Options: Do nothing or Halt project execution (the workflow stops processing and displays an error).
If a file with such name already existsSelect how EasyMorph will handle saving the file if a file with the same name exists in the destination folder. Options: Overwrite, Rename the existing file, or Halt project execution. See the "File already exists" table below.

* Setting can be specified using a parameter.


Rename list of files settings

Description: Renames files listed in a table column with new names from a second column.

Settings Description
File pathsSelect the column containing the fully qualified paths and filenames of the files to be renamed.
New namesSelect the column containing new file names.
If a file with such name already existsSelect how EasyMorph will handle saving the file if a file with the same name exists in the destination folder. Options: Overwrite, Rename the existing file, or Halt project execution. See the "File already exists" table below.

* Setting can be specified using a parameter.


Delete file settings

Description: Deletes the target file.

Settings Description
File path*Enter or browse to the fully qualified path and filename of the source file.
If the file doesn't existSelect how EasyMorph will handle cases when the source file does not exist. Options: Do nothing or Halt project execution (the workflow stops processing and displays an error).

* Setting can be specified using a parameter.


Delete list of files settings

Description: Deletes multiple files listed in a table column.

Settings Description
File pathsSelect the column containing the fully qualified paths and filenames of the files to be deleted.
If the file doesn't existSelect how EasyMorph will handle cases when the source file does not exist. Options: Ignore or Halt project execution (the workflow stops processing and displays an error).

* Setting can be specified using a parameter.


Create folder settings

Description: Creates a new folder.

Settings Description
Folder name*Enter the name of the new folder.
Parent folder*Enter or browse to the folder the new folder will be created within.
If a folder with such a name already existsSelect how EasyMorph will handle cases when a folder with the same name already exists in the selected parent folder. Options: Fail (the workflow stops and displays an error) or Do nothing.

* Setting can be specified using a parameter.


Clean folder settings

Description: Deletes all files in the selected folder. If selected, subfolders can also be cleaned, or deleted.

Settings Description
Folder*Enter or browse to the folder to clean.
SubfoldersSelect what action to take on subfolders under the selected folder. Options: Delete (delete all subfolders), Clean recursively (delete files within all subfolders, at all levels), or Do nothing.

* Setting can be specified using a parameter.


Delete folder settings

Description: Deletes the target folder.

Settings Description
Folder*Enter or browse to the folder to delete.
If folder doesn't existSelect how EasyMorph will handle cases when the folder is not found. Options: Fail (the workflow stops and displays an error) or Do nothing.

* Setting can be specified using a parameter.


Zip file settings

Description: Creates a compressed zip file from the selected file.

Settings Description
File*Enter or browse to the fully qualified path and filename of the source file.
Archive*Enter or browse to the fully qualified path and filename of the resultant zip file.

* Setting can be specified using a parameter.


Zip folder settings

Description: Creates a compressed archive of all files in the selected folder.

Settings Description
Folder*Enter or browse to the folder to compress.
Include folder itselfThe selected folder will be included in the resultant zip file. Otherwise, the zip file will only contain the files within the selected folder.
Archive*Enter or browse to the fully-qualified path and filename of the resultant zip file.

* Setting can be specified using a parameter.


Unzip archive settings

Description: Decrompresses and saves the folders and files within the selected zip file.

Settings Description
Zip archive*Enter or browse to and select the zip file to decompress.
Target folder*Enter or browse to the folder save the decompressed files to.
Create the folder if it doesn't existCheck this option to create the named Target folder if it does not exist.
If any file with such name already existsSelect how EasyMorph will handle saving a file if a file with the same name exists in the destination folder. Options: Overwrite, Rename the existing file, or Halt project execution. See the "File already exists" table below.

* Setting can be specified using a parameter.



File already exists options

Option Description
OverwriteThe new file replaces the original file.
Rename the existing fileThe original file will be renamed with "backup" and a serial number appended to the file name. The new file will
possess the original filename.
Halt project executionThe project will stop processing and this action will display an error.


Remarks

Unzipping password-protected archives is not supported.

More complex file operations can be implemented using Windows shell commands in the Run program or Iterate external program actions.


Community examples


See also

transformations/filecommand.txt · Last modified: 2021/07/17 15:40 by craigt