String finder
============
This script scans all files within a specified directory for a target string. Once the scan is complete, the script lists all files containing the target string.
- Run the script.
- When prompted, enter the path to the directory you wish to search.
- Enter the target string you want to find.
- The script will then scan all the files within the specified directory for the given string and display any matching file paths.
- scan_files_for_string(directory, target_string): This function scans all files in a directory for a specific string. It returns a list of files containing the target string.
- directory: The path to the directory to scan.
- target_string: The string to search for.
To use the script directly:
$ python [script_name].py
Enter the required inputs when prompted.
- The script reads files using the utf-8 encoding. Files that do not adhere to this encoding or have other read issues will be skipped.
- If there's an error reading a file, or if the file type isn't readable as text (binary files, for instance), the script will simply skip it and continue.