Hello,
I need a powershell script to search a text file for a known line of text ('Line 2 Heading'), delete the following line, replace it with another line and save contents to a new file name.
The line to replace starts with a 'tab'. The line to insert must start with a 'tab' also.
Sample text file contents
Line 1 Heading
Line 1 text
Line 2 Heading
Line 2 text
Line 3 Heading
Line 3 text
Required text file contents
Line 1 Heading
Line 1 text
Line 2 Heading
New text goes here
Line 3 Heading
Line 3 text
Hope this is clear.
Any help appreciated.
Thanks,
Mike