Skip to content
Contact us

ReplaceTextInFile()

Function reference Replaces all occurrences of a string with a file. (Non case sensitive)ReplaceTextInFile ( File, SearchFor , ReplaceWith, AddFileToJobLog )

ArgumentDescription
FileThe name of the input file in which you want to replace SearchFor with ReplaceWith.
SearchForThe string to replace.
ReplaceWithThe string to use as replacement.
AddFileToJobLog‘1’ or ‘true’ will add the modified file to the Job Log.

Data type: String If any replacements are made the function returns a TEMP file name else it returns the original file name from the argument. The function does NOT modify the file in the argument.

This expression is replacing all occurrences of ‘abc’ with ‘xyz’ within the file ‘c:\myFile.txt’ The altered file is added to the Job Log.

ReplaceAll( 'c:\myFile.txt','abc' , 'xyz', '1')