<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Use PowerShell &#187; One Liner</title>
	<atom:link href="http://blog.usepowershell.com/category/one-liner/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.usepowershell.com</link>
	<description>Real Admins Script</description>
	<lastBuildDate>Tue, 07 Sep 2010 22:52:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Finding the K Most Common Words in a File</title>
		<link>http://blog.usepowershell.com/2009/02/finding-the-k-most-common-words-in-a-file/</link>
		<comments>http://blog.usepowershell.com/2009/02/finding-the-k-most-common-words-in-a-file/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 19:38:09 +0000</pubDate>
		<dc:creator>Steven Murawski</dc:creator>
				<category><![CDATA[One Liner]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://blog.usepowershell.com/2009/02/finding-the-k-most-common-words-in-a-file/</guid>
		<description><![CDATA[Doug Finke recently posted a blog post about finding the most common words in a file. Doug put together a little 19 line PowerShell script to solve the issue, but something just called to me about how it wasn’t necessarily playing to some of the included cmdlets in PowerShell. So, here’s my interpretation as a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dougfinke.com/blog/" target="_blank">Doug Finke</a> recently posted a blog post about <a href="http://dougfinke.com/blog/index.php/2009/02/07/powershell-find-the-k-most-common-words-in-a-file/" target="_blank">finding the most common words in a file</a>.</p>
<p>Doug put together a little 19 line PowerShell script to solve the issue, but something just called to me about how it wasn’t necessarily playing to some of the included cmdlets in PowerShell.</p>
<p>So, here’s my interpretation as a one liner:</p>
<p>get-content big.txt | foreach-object {[regex]::split($_.ToLower(), &#8216;\W+&#8217;)} | where-object {$_.length -gt 0} | group-object | sort-object -property count -descending | select-object -property name -first 6</p>
<p>EDIT: One thing I’ve noticed is Doug’s script runs much faster.. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.usepowershell.com/2009/02/finding-the-k-most-common-words-in-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
