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

Copy sections from a text file out to another text file

$
0
0

I'm new to powershell, but I need to read a text file and copy sections out to another text file.  Is this possible?
 
I need to read the first text file line by line until I come to a specific word, (like 'keyword') then starting with the next line copy each line read to another text file until I come to another set of words. (like 'this' or 'that')  then go back to reading the text file until I come to the first 'keyword' again and start copying lines to the second text file again, until I come to 'this' or 'that' again and repeat through the file.  The text file is 26,000+ lines long.
 
Can someone help me with this?


Viewing all articles
Browse latest Browse all 8583

Trending Articles