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

Browse by Tags

All Tags » text   (RSS)

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
Posted by MoW | 2 Comments

Hey PowerShell Guy !, How Can I Remove Duplicate Values From a Pair of Text Files?

Again a Hey Scripting Guy ! translation about replacements in Text files : How Can I Remove Duplicate Values From a Pair of Text Files? To replace the 35 lines Vbscript solution with 3 loops given in the original article, the following PowerShell commands
Posted by MoW | 2 Comments
Filed under: ,

Hey PowerShell Guy !, How Can I Replace Text That Includes Double Quote Marks and a Tab Character?

Some time ago but a new Hey Scripting Guy ! translation to PowerShell How can I replace text that includes double quote marks and a tab character ? the example given in this article is : Speaking of which, let’s talk scripting for awhile. As we understand
Posted by MoW | 2 Comments
Filed under: , ,

Sorting IP addresses, PowerShell vs AWK

A question was asked in the PowerShell Newsgroup how to sort IP addresses with an AWK example for the same task given Keith Hill made a blogpost about the same Newsgroup Post using .NET here : Sorting IP addresses the PowerShell way. but I also liked
Posted by MoW | 0 Comments
Filed under: ,

Hey, powerShell Guy !How Can I Locate a Word in a Text File and Then Echo Back That Word and Any Remaining Text?

Another translation of an example script from a Hey scripting guy column How Can I Locate a Word in a Text File and Then Echo Back That Word and Any Remaining Text? from VbScript to PowerShell . I made these 2 different versions within minutes : Get-Content
Posted by admin | 1 Comments
Filed under: , ,

PowerShell examples used on ars technica

Ars technica did an article about PowerShell : Microsoft PowerShell rolled into Longhorn Server In this article two PowerShell examples from my blog are used : How to get the uptime of a specific service: $s = gwmi win32_service -filter "name = 'spooler'"
Posted by admin | 9 Comments
Filed under: , , , ,

Hey PowerShell Guy !,How Can I Parse a Tab-Delimited File and Then Save That as a Comma-Separated Values File?

from the Hey Scripting Guy article : How Can I Parse a Tab-Delimited File and Then Save That as a Comma-Separated Values File? gc tab.txt |% {$_.split("`t") |? {$_ -match '='} |% {$r = new-object object} {$r | add-Member -memberType noteProperty -name

Hey, PowerShell Guy! How Can I Count the Number of Characters in a Text File?

And another VbScript to PowerShell translation of a scripting Guy Column, and (as expected ) again not to much problems with it this time ;-) How Can I Count the Number of Characters in a Text File? gc Text.txt | Measure-Object -Character to do also line
Posted by MoW | 0 Comments
Filed under: ,

Hey, PowerShell Guy ! How Can I Tally Up All the Words Found in a Text File?

And an other Hey Scripting guy ! translation to PowerShell How Can I Tally Up All the Words Found in a Text File? Hey, Scripting Guy! While browsing the Internet I found a script that showed me how to get a list of all the unique words in a text file.
Posted by admin | 7 Comments
Filed under: ,

Scripting Games 2007 Advanced PowerShell Event 6

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 =
Posted by admin | 0 Comments

Hey PowerShell, how popular is this Baby Name ?

When I did see this blogpost : Baby Names, Nameless Keys, and Mumbling , I also decided to "scrape" the Social Security Administration's Popular Baby Names site I already did some webpage scraping like this in PowerShell : generate a random list of surnames
Posted by admin | 4 Comments
Attachment(s): BabyNames.ps1

Sesame PowerShell : Scripting Text Files

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
Posted by admin | 6 Comments