Replace in File


Replaces the content in a plain-text file.

Parameters

  • File name Specifies a full-qualified name of the file.

  • Start position Specifies the initial position for finding.

  • Find what Specifies the sub string to search for.

  • Replace with Specifies the substitution string. To remove the sub string from the variable, left the field blank.

  • Match case Specifies the searching is case-sensitive or not.

  • Replace all Specifies whether to replace the next matched string or replace all matched.

  • Use regular expression Specifies whether to use regular expression. With this option unchecked, you may also use wildcards such as asterisks (*) and question marks (?) in search string.

  • Backup original file Specifies whether to backup the ordinal file before saving the changes.

  • Populate variable with number of substitutions made If the sub string (pattern) is not found, return value is 0.

  • Populate variable with next start position Specifies a variable to hold the next start position, the next start position is calculated by the follow formula:

    next start position=first occurrence position + size of substitution string

Notes

  • For more information about regular expression, you may visit at http://en.wikipedia.org/wiki/Regular_expression.