Python 3 Text Mining or Analysis Script to Analyze a Text File to Count Number of Words,Lines and Special Characters Full Project For Beginners

You are currently viewing Python 3 Text Mining or Analysis Script to Analyze a Text File to Count Number of Words,Lines and Special Characters Full Project For Beginners

 

Welcome folks today in this post we will be doing text analysis about as text file such as counting no of words,lines and special characters in python. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to make an app.py file and copy paste the following code

 

app.py

 

 

 

And now if you execute the python script you need to provide also an additional command line argument which will be the path of the text file to analyze in this script.

 

python app.py input.txt

 

This is the input.txt file that i am analyzing is shown below

 

input.txt

 

 

 

 

 

So now as you can see it has returned all the information about the text file i.e. how many characters and lines and also unique words and also special_characters. All this information is contained inside a json object

 

Leave a Reply