Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

Hey PowerShell Guy, How Can I Sort the Contents of a Text File in Numerical Order?

I spotted a secred VBscript only spoiler here ? : How Can I Sort the Contents of a Text File in Numerical Order?

Guess why they tought a PoSH version was not needed ;-)

Get-Content test.txt | sort {[void]($_ -match '\d*');[int]$matches[0]}

For more text training see : Sesame PowerShell : Scripting Text Files 

Or would they search more for this :

 Enjoy your training, see you at the games

Speaking of which, have I mentioned that the 2008 Winter Scripting Games begin February 15th?  

Greetings /\/\o\/\/

Published Saturday, January 26, 2008 4:23 PM by MoW

Comments

# Interesting Finds: January 27, 2008

Sunday, January 27, 2008 11:39 AM by Jason Haley

# » Daily Bits - January 28, 2008 Alvin Ashcraft’s Daily Geek Bits: Daily links, development, gadgets and raising rugrats.

Anonymous comments are disabled