I am trying to find the count of each and every string in a text file. I found only the code for a small sentences but i need for a text file.
For eg : if a text file named sample contains
"There was a fisherman named Fisher
who fished for some fish in a fissure.Till a fish with a grin,pulled the fisherman in.
Now they're fishing the fissure for Fisher."
the output i am trying to get is :
There - 1
a - 4
fisherman - 2
and so on. Please help me with this.