I have a folder full of HTML files:
001.htm
002.htm
003.htm
…
I want to run Pandoc on them to convert them to similarly named Markdown files:
001.md
002.md
003.md
This command works on one of them:
pandoc -f html -t markdown 001.htm -o 001.md
And I want to use find
and xargs
to automatically run a similar command on every file in the folder.
I got as far as this:
find *.htm | xargs -I {} -n 1 pandoc -f html -t markdown -o {}
…which truncates every file in the directory, so now I'm asking before I really break something.
What is wrong with my command above, and/or what's a completely different / more efficient way to do this?