Skip to content

VarrunVashisht/PythonProject_Text-Reader-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงพ Text Reader & Analyzer

A fun beginner Python project for practicing file handling! ๐ŸŽ‰


๐Ÿ“˜ Overview

This project helps you read and analyze any text file (sample.txt) using Python.
Itโ€™s designed for beginners to understand how to:

  • Open files using open() and with open()
  • Read text from a file
  • Count lines, words, and characters
  • Search for words inside text
  • Save results into a simple report file

Itโ€™s small, simple, and perfect for learning the basics of Python file handling.


๐Ÿง  What Youโ€™ll Learn

โœ… How to open, read, and close files in Python
โœ… How to use read(), readline(), and loops
โœ… How to search text and count words
โœ… How to write data into another file
โœ… How to build and organize a beginner project


๐Ÿ—‚๏ธ Folder Structure

text-analyzer/ โ”œโ”€โ”€ README.md โ”œโ”€โ”€ main.py โ””โ”€โ”€ sample.txt

Step 2: Run the program

Make sure you have Python installed (3.8 or higher). Then run:

python main.py

๐Ÿงฉ Features Feature Description ๐Ÿ“„ Read Text File Opens and displays your text file ๐Ÿงฎ Count Stats Shows total lines, words, and characters ๐Ÿ” Word Search Finds lines containing your keyword ๐Ÿ“ Save Report Creates a simple report file with text stats ๐Ÿง  Beginner Friendly Perfect for learning Python basics ๐Ÿ“œ Example Output ๐Ÿ“– Text Reader & Analyzer

1๏ธโƒฃ Show full text 2๏ธโƒฃ Count lines, words, characters 3๏ธโƒฃ Search for a word 4๏ธโƒฃ Save a report 0๏ธโƒฃ Exit

Enter your choice: 2 ๐Ÿ“Š Text Summary: Lines: 5 Words: 47 Characters: 290

๐Ÿง  Sample Text (sample.txt)

You can start with this simple text file:

Python is fun to learn. Reading and writing files makes it even better! This is a beginner project to understand file handling. Let's keep learning and growing with Python!

๐Ÿ’พ Output Report (report.txt)

When you choose option 4, your report will look like this:

๐Ÿ“Š Text Analysis Report

File: sample.txt Lines: 5 Words: 47 Characters: 290

๐Ÿ’ก Ideas to Improve

Here are a few fun ideas to make this project even better:

Add colors to the output using colorama ๐ŸŒˆ Show the top 3 most common words Allow the user to choose a custom file name Add reading time estimation (based on word count) Display a progress bar while reading the file

๐Ÿง‘โ€๐Ÿ’ป Technologies Used: Python 3.x No external libraries โ€” just built-in functions!

๐Ÿ‘ฉโ€๐Ÿซ Author Varrun Vashisht

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages