Skip to content

Files

Latest commit

 

History

History
 
 

Text-File_Analyzer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Text File Analyzer

This Python script reads a text file and provides a basic analysis by counting the number of lines, words, and characters in the file.

Usage

  1. Make sure you have Python installed on your system.

  2. Save the script as text_file_analyzer.py in your desired directory.

  3. Run the script using a terminal or command prompt.

  4. The script will prompt you to enter the path of the text file you want to analyze.

  5. After entering the file path, the script will display the following information:

    • Number of lines in the file
    • Number of words in the file
    • Number of characters in the file

Example

Suppose you have a text file named sample.txt with the following content:

This is a sample text file. It contains multiple lines of text. Let's see how the analyzer handles it.

Running the script and providing the path to sample.txt would output: Number of lines: 3 Number of words: 17 Number of characters: 96

Note

This script provides a basic analysis for simple text files. It may not handle complex file formats or special cases.