Link to home
Start Free TrialLog in
Avatar of Mario Pichardo
Mario Pichardo

asked on

Positive Lookahead

I file a file that updates whenever a file is uploaded to a particular server. I need a positive lookhead whenever whenever the pattern reaches the word "Archived".  Here is the string I use for a pattern:

Downloaded Files: 02-01-2018 09:22:30
=========================================================================
Successful Download: 180125.65.BMT.zip
Successful Download: 180128BMT.zip
Uploaded Files on SFTP Server: 02-01-2018 09:22:30
=========================================================================
Successful Upload: B10.DAT
Successful Upload: B9.DAT
Archived Files on Server: 02-01-2018 09:22:30
=========================================================================
Successful Archived: Q9535.BMT.zip
Successful Archived: Q9800.BMT.zip
Downloaded Files: 02-02-2018 02:00:03

I created the following pattern:


$patter = "Uploaded Files on SmartTelecom SFTP Server:  "+ (get-date).toString("MM-dd-yyyy")

Which will pull today's date. I just need a way to copy everything (including new lines) up until "Archived"

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of oBdA
oBdA

Question answered.