ByteOfWaffle / Search-Engine

Search engine made with python
1 stars 0 forks source link

Text File Search Tool

A simple Python program that allows users to search through text files for specific words or lines. The tool provides two main functionalities: searching for complete lines containing a word and searching for exact word matches and the amount found.

Features

Requirements

⚠️⚠️⚠️txt file must be in the same file directory as the python script⚠️⚠️⚠️

Usage

Run the script using Python:

python main.py

Menu Options

  1. Search for a line: Finds all lines containing the specified word
  2. Search for a word: Finds exact word matches in the text

Search Modes

Line Search

Word Search

Example Usage

# Example for line search
What file do you want to search in? (must be txt) test
Enter a word to search for: pepe
 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
The word was found in 2 lines
Line: pepe was a war hero (Line 4)
Line: pepe popo kokoko doko was coco (Line 8)
 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

# Example for word search
What file do you want to search in? (must be txt): test
Enter a word to search for: pepe
 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
The word was found 2 times
Word: pepe (Line 4)
Word: pepe (Line 8)
 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

Error Handling

The tool includes basic error handling for:

Limitations

Author

ByteOfWaffle (Jeremy)