Powershell Title generator
I've got this logfile and I need to change all the pronouns to be capitalized and the rest lowercase. Is there a script cat can help me?
July 27th, 2015 2:15am

Hi TJ,

You are looking for something similar to this. Mix of the search and replace.

Powershell to search multiple words in a text file:

http://www.codeproject.com/Questions/614468/powershell-to-search-multiple-words-in-a-text-file

How Can I Use Windows PowerShell to Replace Characters in a Text File?

http://blogs.technet.com/b/heyscriptingguy/archive/2008/01/17/how-can-i-use-windows-powershell-to-replace-characters-in-a-text-file.aspx

You need to load the file contents in a $variable and then loop it through until everything changes.

Initially make everything LowerCase, then search and capitalize.

(Get-Content logfile.log).ToLower() | Set-Content logfile.log		
Free Windows Admin Tool Kit Click here and download it now
July 27th, 2015 7:16am

First consider "what is a pronoun"?

If you want TitleCase the just set Title case.  This has noting to do with pronouns.

$text=Get-Content test.txt
[cultureinfo]::CurrentCulture.TextInfo.ToTitleCase($text)

July 27th, 2015 9:51am

First consider "what is a pronoun"?

If you want TitleCase the just set Title case.  This has noting to do with pronouns.

$text=Get-Content test.txt
[cultureinfo]::CurrentCulture.TextInfo.ToTitleCase($text)

Free Windows Admin Tool Kit Click here and download it now
July 27th, 2015 10:42am

Not if you use pronouns.  Pronouns are smart.

July 27th, 2015 11:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics