in reply to Re: search for a string and return previous relating string if found
in thread search for a string and return previous relating string if found

you caught me out ;-] if have been using powershell select-string, but am having issues with it searching between the !! delimeters in the text files. using a context produces the lines above or below the match, but this is always variable as the code is different on each section of the input file.

 Select-String -Pattern "" -context 2  *.txt

I use a basic perl script to search through for single matches but this stuff is beyond my grasp of Perl

  • Comment on Re^2: search for a string and return previous relating string if found
  • Download Code