DADiSP Worksheet Functions > Function Categories > File Manipulation > FILESTRREP
Replaces a pattern string with a new pattern in one or more files.
FILESTRREP("filespec", "patstr", "repstr", recurse)
"filespec" |
- |
A string. A list of files to process, can include wildcard characters such as * and ?. |
||||
"patstr" |
- |
A string. The original pattern to search for. |
||||
"repstr" |
- |
A string. The replacement pattern. |
||||
recurse |
- |
Optional. An integer, recursively process files in sub-directories. |
||||
|
|
|
An integer, the number of files in which the replacement occurred.
filestrrep("\temp\*.txt", "January", "April")
Returns the count of the number of files in the "\temp" folder with extension ".txt" where the text "January" was replaced with the text "April".
The pattern and replacement strings are case sensitive.
If the pattern is not found in a file, the file remains unchanged.
See STRREPLACE to replace a pattern in a string.