Blog ·

Convert a whole folder of documents to Markdown, with a report

Most people do not have one document to convert. They have a Documents folder with fifteen years of files in it. Converting those one at a time is not a plan. This is how batch conversion works in Anymark, and what to decide before you start.

The decisions

Where does the output go? Two sensible answers. Beside the originals puts report.md next to report.docx, which keeps everything together and is what you want for a folder you work in. Mirrored into another folder recreates the folder tree somewhere else with only the Markdown in it, which is what you want for a knowledge base or an archive.

What about files that already have a Markdown twin? Skip leaves them alone (the default, and the right choice for a re-run). Replace converts again. Keep both writes report (2).md.

Subfolders? Almost always yes.

Pictures? Each converted document’s pictures go into a name_assets folder beside it, or are embedded in the Markdown as data. Folders are easier to browse; embedding makes a single self-contained file.

Running it

File > Batch Convert Folder, pick the folder, pick the options, press Start. A progress bar shows the file being worked on; scanned PDFs take longer because of OCR. At the end a report lists every file: converted, skipped, or failed with the reason, and you can save the report as Markdown too.

Originals are never modified. If a file fails, the report says which and why, and nothing else is affected.

From the command line

The same engine is available for scripts and scheduled jobs:

anymark --convert report.doc > report.md
anymark --batch ./documents --out ./markdown
anymark --batch ./documents --out ./markdown --embed-images --no-recursive

On a Mac the binary is inside the app bundle (/Applications/Anymark.app/Contents/MacOS/Anymark); on Windows it is the installed executable. A trial or licence is needed, the same as in the app; the command line says so and exits with code 2 if there is none.

Things to know before converting ten thousand files

Once the folder is Markdown, it is searchable with any tool, readable on any device, and ready for whatever assistant or indexer you point at it.