|
|
Browse by Tags
All Tags » PowerShell » text » Scripting games
-
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 ...
-
Event 6: Give Me a (75-Column) Break
PS Answer: Give Me a (75-Column) Break
My Answer was not the much different only using (gc alice.txt).split() |% { To loop the words directly ( '' '' is default for split )
Script looks like this :
$t = ''
$length = 0
(gc alice.txt).split() |% {
if ($length -eq 0) {
$t += ''$_''
...
-
Again I will mimic a Scripting Guy article here in PowerShell, only this time from the Sesame Script series :
Sesame Script: Scripting Text Files
Preamble
As this entry also was written as a training for the International Winter Scripting Games, And just to make you feel even better about entering, this month’s Sesame ...
|
|
|