skrf.util.findReplace

skrf.util.findReplace(directory, find, replace, file_pattern)[source]

Find/replace some txt in all files in a directory, recursively.

This was found in [1] .

Parameters:
  • directory (str) – path of a directory

  • find (str) – pattern to search for

  • replace (str) – string to replace with

  • file_pattern (str) – file pattern for filtering. Ex: ‘*.txt’.

Examples

>>> rf.findReplace('some_dir', 'find this', 'replace with this', '*.txt')

References