Is there any way to look for a directory path that is listed any number of lines *before* a keyword in an error message?
I have a script that is trying to process different files that are always down a certain portion of a path, and if there is an error, then says there is an error, contact "the vendor". The count of lines between the path/file that's listed and the actual error is always different, so I can't "cut" based on that pattern. Here's basically what it looks like in the log:
\\server\dir\dir\appdir\...\filename
varied number of lines of data
Unknown problem: "Contact the vendor"
Is there any way to look for the keyword "vendor" and scan "backwards" to find the path/file which I can then cut, put into another file, and manipulate further?
Thanks for any help you can provide,