To search the text inside a folder of PDF and Word files, convert the folder to Markdown with MD Factory and search the Markdown files. Each one is plain text saved next to its original, so Visual Studio Code or PowerShell can find a phrase in every document at once and show the line where it appears.
You convert once and search as often as you like. Scanned PDFs are searchable too, because their text is recognized during conversion.
Convert the folder
- Open MD Factory and click Add folder, or drag the folder onto the window. Its subfolders are included.
- Conversion starts right away. Wait until every row shows Completed, Needs review or Failed.
- Click Needs review next to a file to see what to check. For a scan, the usual cause is text that OCR could not read, and a search will not find what was not read.
Contracts/
supplier-2025.pdf
supplier-2025.md
supplier-2026.docx
supplier-2026.md
Scans/
lease.pdf
lease.md
A folder of mixed files works: PDF, Word, PowerPoint, Excel, ebooks, saved web pages and emails are all converted.
What a search covers
| Document | What you can find | What you cannot |
|---|---|---|
| PDF with text | Body text, headings and table cells | Page numbers, because the Markdown has none |
| Scanned PDF | The text OCR recognized | Text OCR misread or could not read |
| Word | Body text, headings and tables | Footnotes, endnotes, headers and footers |
| PowerPoint | Slide text and speaker notes, hidden slides included | Charts and SmartArt |
| Excel | The values saved in the cells | Formulas and cell comments |
Word files with footnotes, endnotes, headers or footers are marked Needs review. Search those parts in the original document.
Excel dates are written as 2026-03-15 00:00:00, so search for the date in that form. Underscores in Excel cells are written as the code _, so a name like order_id is stored as order_id: search for it that way. The Excel guide lists the other changes.
Search with Visual Studio Code
- In Visual Studio Code, choose File, then Open Folder, and pick the folder.
- Press Ctrl+Shift+F and type the phrase.
- To skip the original files, click the three-dots button under the search box and type *.md in the files to include box.
The results are grouped by file, with the matching lines under each file name. Click a line to open the file at that spot. The buttons at the right of the search box turn on case matching (Alt+C), whole words (Alt+W) and regular expressions (Alt+R). Visual Studio Code's guide to basic editing covers searching across files.
Search with PowerShell
Open PowerShell in the folder: in File Explorer, click the address bar, type powershell and press Enter. Then run:
Get-ChildItem -Recurse -Filter *.md | Select-String -Pattern "payment terms" -SimpleMatch -Encoding utf8
Each match is printed with its file, its line number and the line itself. Leave out -SimpleMatch to use a regular expression, for example 2026-0[1-3] to find dates from January to March. Add -Context 1,1 to show a line before and after each match.
To list only the files that contain the phrase:
Get-ChildItem -Recurse -Filter *.md | Select-String -Pattern "payment terms" -SimpleMatch -Encoding utf8 | Select-Object -ExpandProperty Path -Unique
Keep -Encoding utf8 in the command: without it, Windows PowerShell can misread accented and non-Latin letters. The options are described in Microsoft's Select-String reference.
Search for several words, or count the matches
To find either of two phrases, join them with a vertical bar in a regular expression: payment terms|late fee. Turn on regular expressions in Visual Studio Code, or leave out -SimpleMatch in PowerShell.
To see which documents mention a phrase most often, group the matches by file:
Get-ChildItem -Recurse -Filter *.md | Select-String -Pattern "late fee" -SimpleMatch -Encoding utf8 | Group-Object Path | Sort-Object Count -Descending | Select-Object Count, Name
To keep the results, add | Out-File results.txt -Encoding utf8 to the end of a command.
Which tool to use
| Tool | Best for |
|---|---|
| Visual Studio Code | Looking around: click a result, read the text around it, change the search and try again |
| PowerShell | Counting, listing the files that match, and saving the results to a file |
Go from a match to the original
A Markdown file has the same name as its document, so supplier-2026.md leads back to supplier-2026.docx. The Markdown has no page numbers. To find the page, open the original, press Ctrl+F and search for the same phrase.
Before you rely on a match
A match shows that the text is in the Markdown file, not that it is correct. Before you quote a figure or a clause, open the original and read it there. This matters most for text recognized from a scan.
If a search finds nothing
- Search for fewer words. A sentence can break across lines or pages in the original, and a shorter phrase still matches.
- Try other spellings. OCR can read a 1 as an l or a 5 as an S, so search for the part of the word around the doubtful letter.
- Check the status of the file. A file marked Failed has no Markdown file, and Needs review points to something that may be missing.
Keep the search current
When a document changes, add it to MD Factory again. If you have not edited its Markdown file, the new result replaces it. If you have, the new result is saved as a numbered copy, such as supplier-2026 (2).md, and a search finds both.
If you keep your notes in Obsidian, its vault search does the same job: see how to import PDF and Word files into Obsidian. To let a coding agent search the same folder, see how to give Claude Code, Cursor and Codex your PDFs and Word files.
Questions
Does the search find text in scanned PDFs?
Yes, the text that OCR recognized, spelled the way it was recognized.
Do I need to keep the original files?
Yes. Page numbers and the exact layout are only in the originals, and you will go back to them to check a match.