catalight.analysis.tools.list_matching_files

catalight.analysis.tools.list_matching_files(main_dirs, target, suffix)

Return files containing ‘target’ and ending in ‘suffix’ within a folder.

Returns the full path of all files within the give folder path that contain the phrase ‘target’ and ends with ‘suffix’. This function crawls the ENTIRE directory provided, including all sub-folders down to bottom depth.

Parameters:
  • main_dirs (list of str) – List of string paths to main directories to crawl for data. Can be a list of one to search a single directory.

  • target (str) – String of target phrase for finding files.

  • suffix (str) – String target for the file type to search for.

Returns:

List of filepaths ending with ‘suffix’ and containing ‘target’

Return type:

list(str)