Action Part: Target and Backup Files

Near the bottom of the Action panel, you can select how PowerGREP should save, modify or copy files while you execute the action. To run an action without modifying any files at all, simply use the Preview button. Previewing an action never modifies any files or do anything else you might regret.

Target and backup options

Target Files

Target File Creation

The available target types depend on the kind of action you have prepared. Seven target types are available for "search", "collect data", and "file or folder name collect" actions:

For a "list files" or file or folder name search action, nine target types are available:

If you set "what to search through" for a "file and folder name search" action to search through folder names, then you get a different list of nine target types:

A "search and replace" or "search and delete" action offers three target types:

The "merge files" action type offers three choices:

When you set the action type to "rename files or folders" you can choose to rename or copy the files or folders to their new names. Because there are different implications to changing a file's name, a file's path, a folder's name, or a folder's path, the available target types depend on the "what to rename" setting at the top of the action panel. When it is set to "file names only", you get these target types:

When renaming relative or full paths to files, the target types change slightly to refect that changes to a file's path can move the file into a new folder:

You can compress or decompress individual files by adding or removing extensions of individual compression formats like .gz or .xz.

When moving or copying folders, there are two ways of dealing with the files in those folders. The folders can be copied or moved entirely, or the contents of those folders can be copied or moved as individual files.

You can compress folders by adding an extension of an archive formats like .zip or .7z to their name. You can decompress archives by removing those extensions from their names.

Target File Destination Type

Select the type of place you want the target files to be created. Except when using path placeholders, target files will have the same name as the original files.

Target File Location

Specify a target location of the type selected in the target file destination type list. Click the (...) button to interactively select or build the target location.

Target File Text Encoding

Select the Unicode encoding or the Windows code page the target file(s) should use. Choose "same as original file" if unsure.

Target File Line Break Style

Select the character sequence to be used to separate lines in the target file. Choose "same as original file" if unsure.

Order of Matches from Different Files

When collecting data into a single file without both grouping identical matches and grouping results for all files, this option determines in which order the collected matches are saved into that file.

Backup Files

Whenever you specify a target type that may cause files to be overwritten, you should specify how PowerGREP should create backup copies of files that are overwritten. While you can tell PowerGREP not to create backup copies at all, this is not recommended. PowerGREP needs the backup copies to be able to undo the action in the Undo History. If no backup files are created, PowerGREP will not add the action to the Undo History at all.

Backup File Naming Style

When a target file already exists, PowerGREP can make a backup copy of the file before overwriting it. The name of the backup copy is based on the name of the target file.

Backup File Destination Type

Select the type of place you want the backup files to be created.

Backup File Location

Specify a target location of the type selected in the backup file destination type list. Click the (...) button to interactively select or build the backup location.