Created
April 16, 2014 02:49
-
-
Save Joshfindit/10800736 to your computer and use it in GitHub Desktop.
Text analysis for word frequency (good for finding common words in marketing material)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#First, create a folder and copy the raw text from each page in to it's own text file. | |
#Example: harv_eker1.txt , harv_eker2.txt , harv_eker3.txt , and so on. | |
#Open a terminal window in that folder, and run the following: | |
cat *.txt | tr -d '[:punct:]' | tr ' ' '\n' | tr 'A-Z' 'a-z' | sort | uniq -c | sort -rn | |
#most-used words will be at the top |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment