BE_FileReplaceText ( pathOrContainer ; expression ; replaceString {; options } )

Much like the native Substitute function, but for a text file on disk or stored inside a container field.

Version : 4.2

Parameters : 

pathOrContainer : either a full path to the file on disk, or a container field.  If the container field contains only text, then it will be read as a path.
expression : The text string to look for in the file.
replaceString : The text string to replace it with in the file.
options ( optional ) : 

  i - case insensitive
 m - multiline
 s - dot matches all characters, including newline
 x - ignore whitespace
 g - replace all
Default is "gi" which matches the native FileMaker substitute.  These options work exactly the same as the RegularExpression function.

Result : If working on a file on disk, the file on disk will be modified in place.  If working with a container field, it will be the output of the function, in other words a new file - you will then need to set the result into a container field to store it.

Still need help? Contact Us Contact Us