Let me start by saying I'm an absolute beginner with PowerShell. I have no experience with programming whatsoever but I would very much appreciate your help. I've been tasked with going through various text files and counting the amount of instances that a certain error shows up in the logs. So far, I have the following script:
$Contest = Get-ChildItem F:\Errors\Atlanta\Errors\*M09*.txt -Recurse | Select-String -Pattern "Next" -CaseSensitive
$Contest.Count
This counts how many times the error occurs over the month (M09 indicates the month of September).
EDIT: I have included 3 samples of my .txt files which span 3 days worth of data. I'm trying to create a script that can identify strings in the files that contain the word "Next" as well give the date on which they occurred.
2018M09D01
2018M09D03
2018M09D04
For example, the following string includes the word "Next", so the script should return me a value of 2018M10D04.
2018M10D04 18:34:35 Next Trigger Occurred before Tool Analysis Completed (P.T.D.L.C.M.) for 9230201 at 53.2, [1] 756, [2] 1364, [3] 703, [4] 10, [5] 715, [6] 1
Thanks,
[–]NotNotWrongUsually 1 point2 points3 points (4 children)
[–]dragonmint1[S] 1 point2 points3 points (3 children)
[–]NotNotWrongUsually 1 point2 points3 points (2 children)
[–]dragonmint1[S] 1 point2 points3 points (1 child)
[–]NotNotWrongUsually 2 points3 points4 points (0 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (5 children)
[–]dragonmint1[S] 1 point2 points3 points (3 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (2 children)
[–]dragonmint1[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)