Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to only collect lines AFTER a specific string in output

$
0
0

Hi guys,

I have an issue;

My code uses the output of another tool (That I have no control over)

 

Imagine that the output of the tool is ;

Creator:

Mike

Comments:

Blah blah blah

Files changed since last sweep:

\\files\blah\blah

\\files\blah\blah2

\\files\blah\blah3

 

Now normally I use this

$MyVar = tool.exe <number> | Select-String \\files

 

and that works perfectly fine. Unfortunately for me (and I have no control over this), some... not so smart people will list files in the comments section (even though they're specifically told not to), which messes up the results. So for example this would be the actual output of the tool:

Creator:

Mike

Comments:

Blah blah blah

\\files\blah\blah changed for blah blah reason

\\files\blah\blah2 not changed for blah blah reason

Files changed since last sweep:

\\files\blah\blah

\\files\blah\blah2

\\files\blah\blah3

 

 Is there any easy way I can do select string for lines ONLY after "Files Changed since last sweep"?

 

Thanks in advance everyone!


Viewing all articles
Browse latest Browse all 6937

Trending Articles