Batch Text Replacer - Online help


Program help as PDF

Integration into the Windows Interface

Start program from the Windows Interface

Just double-click the program icon on your desktop or start the program from the Windows Start Menu.

Use context menu

Right click on the files you would like to rename, select the Send To menu and then Batch Text Replacer.

"Drag & Drop" support

Batch Text Replacer supports "Drag & Drop". For example, you can drag files to be edited onto its program icon.

Manage files

Manage files

Add files or folders

Opens a selection dialog in which you can select the text files to be edited or their parent folders.

File list menu

This menu contains various entries to adjust the status of the list items (e.g., "select all entries").

File filter

Clicking on this button opens the dialog for specifying the file filter settings. The number at the end of the label shows the current number of filtered files.

Correct the auto-detected encoding

Correct the auto-detected encoding

Batch Text Replacer tries to detect the encoding of the added text files automatically. For some files, this is not possible with absolute certainty. In this case it is possible to correct the automatically detected encoding for the selected list entries.

Actions

Actions

There are various types for the editing of the text (for example, Replace, Insert). These types are called actions. Actions consist mostly of two areas. In one area is defined which part of the text should be edited. The other area is used to define the way in which this part of the text is to be changed or adjusted. Actions can be combined and are applied in the order they occurred. The actions including the filter and sort settings can be saved in a profile.

Action types

Edit text

This action type is used to edit text with one or more lines. An application example of this action type would be to edit (e.g,, replace or move) a paragraph. Specifying a particular occurrence refers to the beginning or end of the text.

Edit line text

This action type is used to edit an area or text within each line. An application example of the action type would be to edit (e.g,, replace or move) word number 1 to 3 in all lines. Specifying a particular occurrence refers to the beginning or the end of line.

Edit lines

This action type is used to edit complete rows (rows are considered as objects). An application example of this action type would be to edit (e.g,, replace or move) the first 10 rows. Specifying a particular occurrence refers to the beginning or end of the text.

Store in variable

This action type is used to store text or lines in variables for later processing. An application example of this action type would be to save the first paragraph in a variable, remove the surrounding area and then insert the content of the variable to a new position.

Variables can be included within text parameters by using the notation "{variable1}" or "{My_Variable}". An example: (replace with --> text --> Order No. {MyVar1} from {MyVar2}" - the result might be "Order No. 7 from March, 20 2013".

Action groups

Action groups serve to accommodate actions that should be applied only to a portion of the text or only on certain lines. To narrow down the text to edit, there are several tools available in Batch Text Replacer. For example, using the area limiter, the beginning and the end of the text to be edited can be limited. Action groups can be nested together. Another action group is the "repeater", which allows the repeated execution of the actions contained.

Change Encoding

This action type allows you to change the encoding of a text (e.g., from ANSI to UTF-8) as well as the encoding of newline characters.

Regex

Batch Text Replacer supports Perl Compatible Regular Expressions. These can be used in almost all of the input fields by activating the "Rx" button.

When using the Replace function, back references are possible by using "Replace with --> a text".


You can find information about the syntax on the following pages:

Action list

Action list

In the action list, all actions are summarized. Their order will be considered in the calculation of the new text. Actions can be individually named for clarity. It is possible to deactivate an action. The order of actions can be determined by moving the entries using Drag & Drop. For reuse, the actions (including the disabled) can be stored as a profile.

Add actionAdd action

Remove actionRemove action

Clear action listClear action list

Name action individuallyName action individually

Duplicate actionDuplicate action

Manage profiles

A profile consists of one or more actions as well as the settings of the file filter. The profile overview contains all self-generated profiles as well as the enclosed templates.

Categories:

For a better overview, the profiles can be stored in different categories.

Edit profiles:

User-created profiles can be renamed, deleted and imported or exported.

Preview

Preview

In the preview, the effect of the changes on the selected file list entry or the entered text in real time are displayed. This allows for a check in advance of the outcome.

Toolbar

Set preview mode

One can choose between a detailed preview and the standard preview. In the detailed preview the differences are highlighted for clarity; in contrast to standard preview where due to the complex calculation a maximum of 100,000 lines is displayed.

Always jump to the first differenceAlways jump to the first difference

Scroll vertical synchronouslyScroll vertical synchronously

Cut selected textCut selected text

Copy selected text to the clipboardCopy selected text to the clipboard

Paste from clipboardPaste from clipboard

Select allSelect all

Line background colors

  • Yellow background
    This background color is displayed above and below a section with changes.
  • Red background
    This background color indicates the lines of a section with changes.

Output

Output Settings

  • Overwrite existing files
    Optionally, the modified files can be stored in a restorable ZIP archive. In the Restore dialog, the changes to the files can be undone.
  • Create new files
    When activated, the output is made into a newly created file with a file name based on the original file name including a time stamp as suffix. Optionally, existing files can be overwritten.

Output

Displays the status of the files to be written in a list.

Output

File filter

By using the filter, the files to be processed can be limited. Filters can be combined. For many comparison operations, multiple terms separated by the "|" character can be entered (e.g., htm|css|txt). When deactivated, the filter must be reactivated manually.

Filters are also saved as part of profiles.

File search

The file search can be used to limit the files to be processed. It is divided into three steps.

Step 1 - Specifying the search location

Either the program file list or a folder, selected through the folder selection dialog can serve as search location/source. In addition, some files can be excluded using the filter and optionally, sub-folders can be searched.

Step 2 - Define the search parameters

You can enter single-line or multi-line search terms. The following options are available:

  • Match case
    Determines whether the case of the entered search term will be evaluated.
  • Compare whole words only
    Determines whether a separating character should be in front of and behind the reference.
  • Ignore surrounding whitespace in all lines of the search term
    Determines if the search term is searched for independently of leading and trailing spaces.
  • Interpret search term as regular expression
    Determines if the search term is evaluated as a Perl-compatible regex.
  • Use as a placeholder for exactly one character
    When enabled, the specified characters is evaluated as a wildcard for a single character (for example, allows finding Doe via D?e).
  • Use as a placeholder for several (even none)
    When enabled, the specified character is evaluated as a wildcard for multiple or none characters (for example, allows finding Doe on D*).

Step 3 - Validation of results and optional further processing

The references are listed in a tree view. In each branch the line numbers are contained, in which the search term was found. If you click on a list entry, the corresponding line is displayed in the overlying preview.

For further processing, you can choose from the following options:

  • Add to Batch Text Replacer's file list (with prior emptying)
  • Add to Batch Text Replacer's file list
  • Save as file list...
  • Copy to Clipboard
  • Open with default text editor

As an option, by clicking on the "Next (optional)"-button, an additional search within the matching files starts to further narrow down the result.

Statusbar

Program status

Displays the status when executing a function that could take an extended amount of time (e.g., reading files).

When reading files and folders, the button Cancel Process is displayed. You can cancel the reading process by clicking on this button.

Hints

Displays brief information about the user elements beneath the mouse cursor.

Preview status

When activated, the changes to all files are pre-calculated.

Options

Program

  • Search for updates at program start
    Checks at each program start, if a new version of Batch Text Replacer is available.
  • Default Text Editor
    Sets the external text editor, with which the currently selected files can be viewed or opened for inspection.

Backups

  • Limit number of backups to
    Here, the maximum number of backups to be stored can be set.
  • Confirm automatic deletion
    When exceeding the maximum number of backups to be stored, the automatic deletion of the extra backups must be confirmed.

Confirmations

  • Clear action list
    Determines whether the emptying of the action list should be confirmed.

Other

  • Do not read files with binary content (recommended)
    Since an error-free processing of files with binary content (e.g., jpg, docx, avi, xls) can not be guaranteed, it is recommended to leave this option enabled.

Exclusion

The exclusion filter allows you to exclude unwanted files or folders in advance of processing (e.g., DLLs, Temp folder, etc.). Unlike to using the profile filter, objects excluded here are not kept. Therefore, there is no time-consuming testing.

Command line

Syntax

  • BatchTextReplacer /"File to read #1|#2|#3|..." [Options]
  • BatchTextReplacer /folderselectionlist " Path to a FSL file (folder selection list)" [Options]
  • BatchTextReplacer /textfile " Path to a TXT file" [Options]
Note: FSL files are simple text files with a line-by-line listing of one or more folder paths.

Example

BatchTextReplacer /"D:\Data\1.txt| D:\Data\2.txt " /profilefilename "D:\My Profiles\Text replacement (final).TmProfile"

Options (Profiles)

Parameter Description
/profilefilename "Path of the profile to use"
/profile "Profile category|Profile name"
e.g., "HTML|Header correction"

Examples of use and step-by-step guides

Search and replace text in multiple files