Replace in File Action Replace Tab
This tab of the Replace in File action specifies the file to be processed and options about matching to be performed.
Input file: The file to find text in. The entire file will be loaded into memory when the step is built.
Output file: The file to write the updated file contents with any replacements to (optional). The output file can be a different file. The existing file will be updated if this field is blank or the same as the input file. The folder specified in the output filename must already exist.
Ensure output file is writeable: If checked and the output file already exists with read-only attributes, the read-only attribute is removed before overwriting.
Case-sensitive matching: If unchecked, matches are case-insensitive; if checked the case must match when searching.
Replace first match only: If checked, only the first match is replaced; if unchecked, all matches are replaced.
Treat characters as literals: If checked, all text for searching and replacing is treated as literal text (no regular expressions).
Options that apply only to non-literal (regex) replacements:
Dot does not match newline: Causes . (period character) to not match newline characters (negates Perl /s modifier).
Allow comments and ignore white space (Perl extended mode): If checked, white space outside of character classes is (mostly) ignored and anything following an unescaped # character is treated as a comment.
Binary Mode: Treats the file as binary instead of text, performing ASCII text replacements on matching text within the binary file without converting to and from the file's encoding.
Note: Use caution when performing replacements in binary files, as this could render the file unreadable by the source application.
Log file contents before and after replacements: If checked, the file contents are logged before replacements are made and after (if any replacements made).
Do not replace: If checked, no replacements will be made, but any enabled logging will be displayed and a count of replacements that would have been made will be logged. Useful for debugging purposes.
Encoding (code page): The encoding or Windows code page that will be used when reading and writing the file (optional). If left blank, the system code page (CP_ACP) will be used or the encoding specified by the BOM if the file contains a BOM (byte order mark). Other common encodings for files are UTF-8, Unicode (UTF-16 LE), Windows-1252, Cyrillic, Chinese, and other encodings or code pages supported by Windows (see the Microsoft Global Development web site and MSDN Unicode topics for more details).