A file search utility implemented in both Python and C. It scans a directory of text files for a specific keyword and extracts the matching line plus surrounding context.
- Dual Implementation: Available in both Python (
Searchtxt.py) and C (main.c) for performance comparison. - Context Extraction: Captures the line containing the keyword + the next 2 lines.
- Performance: C implementation typically offers faster processing for large datasets.
- Context-Aware: Ideal for log analysis or mining text data where context matters.
Searchtxt.py: Python implementation.main.c: C implementation.word.txt: Config file containing the search term.
- Ensure your
.txtfiles are in atextfiles/folder (input). - Edit
word.txtto contain your search term. - Run:
python Searchtxt.py
- Results are saved to
results.txt.