troubleshooting Question

Need Help Powershell scraping a log file and Adding named regex captured matches to an array .

Avatar of Andre P
Andre PFlag for Canada asked on
Regular ExpressionsPowershell
17 Comments1 Solution193 ViewsLast Modified:
Input
07/12/2001 Jane made 3 pies and stopped after 5 min
08/14/2002 Joe ate 9 apples and started in 20 seconds
   08/14/2002 Joe ate 9 apples and started in 20 seconds


output
Date.           Name   Action      Time.  units

07/12/2001 Jane.    Stopped.   5    min
08/14/2002. joe.      Started 20      seconds

I want to create an array which holds a row for each entry above . [Date Name ,Action,Time,units]
adding a row for each line.

I hope I am clear .
Do I use Select-String with my regex code whch matches the items ?
Or is this a job for get-content ?
I am new to powershell and just nailed the regex to get the named captures
Now I just dont know how to stick them into an array as they are matched ..
ASKER CERTIFIED SOLUTION
Qlemo
"Batchelor", Developer and EE Topic Advisor
Join our community to see this answer!
Unlock 1 Answer and 17 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros