Continuing from Getting the file name from a text file after string matching - PHP I have a log.txt file in the format:
================================================
Header of entry with date and time
================================================
Loaded options from XML file: '/path/to/the/file/some_file.xml
extendedPrintPDF started
Postfix '4.4' was append from file 'some-other_file.xml' for file: /path/to/the/file/some-other_file.indd
printPDF started
PDF Export Preset: Some preset
PDF file created: '/path/to/the/file/some_filey_namex_lo_4.4.pdf'.
File filename_lo-metadata.xml removed
postprocessingDocument started
INDD file removed: /path/to/the/file/some_file1_name_lo.indd
Error opening document: /path/to/the/file/some_file_name_lo.indd: Error: Either the file does not exist, you do not have permission, or the file may be in use by another application; line: 190
================================================
Header of entry with date and time
================================================
Loaded options from XML file: '/path/to/she/file/some_options.xml
extendedPrintPDF started
extendedPrintPDF: Error: Unsaved documents have no full name.; line: 332
I want to catch the word "Error" (if present) for a log entry and then detect the error message (like "Unsaved documents have no full name") or just "Error opening document" and also get the names of all and ONLY the pdf files being created.
I'm a newbie and do not really know how I should go about doing this.
I think I have provided complete information, which I failed to do in my previous post.
CHANGE: I would also like to grab 'the' from /path/to/the/file/filename.something. I am not looking for an EXACT answer (even though it would be great). But, some help or guidance would be appreciated.
NOTE: Is there a way to do it WITHOUT using RegEx (I'm a newbie and also, I am not at all good at RegEx) Thanks