Skip to content

Instantly share code, notes, and snippets.

View Trifused's full-sized avatar

Lawrence Billinghurst Trifused

View GitHub Profile
@arthurattwell
arthurattwell / word-freq.ps1
Last active November 4, 2019 14:36
Word frequency with PowerShell
# PowerShell: Counting words in a text file
# Returns a list of the most-used, longest words in a text file.
#
# Adapted slightly from
# https://blogs.technet.microsoft.com/josebda/2015/03/21/powershell-examples-counting-words-in-a-text-file/
#
# Run this with PowerShell in the folder containing your text, from PowerShell with:
# ./word-freq
# It looks for combined.txt. To get this from a set of markdown files,
# I use Cygwin (because native Windows CLIs have encoding issues) and run: