Простая утилита для поиска ключевых слов в текстовом файле и сохранения результатов.
TextFileScanner - это небольшой Python-скрипт, который позволяет искать заданное ключевое слово в текстовом файле. Найденные строки выводятся в консоль и сохраняются в отдельный файл.
- Создайте файл
scan.txtс текстом для поиска - Запустите скрипт командой
python scan.py - Введите ключевое слово для поиска
- Просмотрите результаты в консоли и в файле
results.txt
> python scan.py
Введите ключевое слово: пример
Строка с примером текста
Еще один пример
Результаты сохранены в results.txt
A simple utility for searching keywords in a text file and saving the results.
TextFileScanner is a small Python script that allows you to search for a specified keyword in a text file. The matching lines are displayed in the console and saved to a separate file.
- Create a
scan.txtfile with the text to search in - Run the script with
python scan.py - Enter the keyword to search for
- View the results in the console and in the
results.txtfile
> python scan.py
Enter a keyword: example
This is an example line
Another example of text
Results saved to results.txt