Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch processing Pandoc conversions in Windows

I am trying to convert a large number of HTML files into Markdown using Pandoc in Windows, and have found an answer on how to do this on a Mac, but receive errors when attempting to run the following in Windows PowerShell.

find . -name \*.md -type f -exec pandoc -o {}.txt {} \;

Can someone help me translate this to work in Windows?

like image 663
christopherritter Avatar asked Jun 17 '13 22:06

christopherritter


1 Answers

to convert files in folders recursively try this (Windows prompt command line):

for /r "startfolder" %i in (*.htm *.html) do pandoc -f html -t markdown "%~fi" -o "%~dpni.txt"

For use in a batch file double the %.

like image 185
Endoro Avatar answered Oct 22 '22 13:10

Endoro