Scraping a batch of text around a result

Is there a way to scrape a certain number of words/characters before and after a keyword you select without converting the files from PDF/DOC/DOCX to TXT? Excel's character limit per cell is hit really quickly by code in non-TXT file formats.

The scraping of words is doable with some regex but SeoTools does not have support for parsing files like PDF and Doc. How are you getting these files into Excel? Do you need all code in a single cell? Perhaps split each line per row to avoid the character limit?

For anyone else running into this issue: I figured this out with a program called DocTo that converts PDF/DOC/DOCX files to TXT; used =Dump(DirectoryList()) on the local directory where the new TXT files are; concatenated the list of files with their base directory; converted local directory paths to URL style paths (from C:\Directory\Files to file:///C:/Directory/Files); then used =dump(regexpfindonurl()) to scrape text from the text files. If my regex code got too long (and it did), then I left it in a cell by itself and made the correlating formula parameter an absolute cell reference to where my regex code was (ex: =dump(regexpfindonurl("file:///C:/Directory/Files/textfiletoscrape.txt",a$1$)).