使用 Pandoc bash 将目录和子目录(递归?)中的所有 .docx 转换为 .md
Convert all .docx in directory and subdirectories (recursive?) to .md using Pandoc bash
我希望 Pandoc 将目录中的所有 .docx 文件转换为 .md。
这个目录有很多子目录,还有子目录等等
我希望输出的 .md 文件与转换后的 .docx 文件位于同一目录(和子目录等)中。
我试过this的多种变体:
find ./ -iname "*.docx" -type f -exec sh -c 'pandoc "[=11=]" -o "./output/$(basename ${0%.docx}.md)"' {} \;
我知道命令的“./output/”部分指定将转换后的文件放在名为 "output"
的目录中
当我从命令中删除“./output/”时,输出的.md 文件都放在命令所在的顶级目录中运行。我希望这些输出文件 "stay" 在它们的 .docx 文件所在的目录中。
我正在使用 Windows 8 和 Cygwin。如果答案需要代码(makefile?),我希望语言是 Lisp(显然,我不是程序员)。
我该怎么做?
基于:Converting all files in a folder to md using pandoc on Mac
我认为应该是:
find ./ -iname "*.docx" -type f -exec sh -c 'pandoc "[=10=]" -o "${0%.docx}.md"' {} \;
我希望 Pandoc 将目录中的所有 .docx 文件转换为 .md。
这个目录有很多子目录,还有子目录等等
我希望输出的 .md 文件与转换后的 .docx 文件位于同一目录(和子目录等)中。
我试过this的多种变体:
find ./ -iname "*.docx" -type f -exec sh -c 'pandoc "[=11=]" -o "./output/$(basename ${0%.docx}.md)"' {} \;
我知道命令的“./output/”部分指定将转换后的文件放在名为 "output"
的目录中当我从命令中删除“./output/”时,输出的.md 文件都放在命令所在的顶级目录中运行。我希望这些输出文件 "stay" 在它们的 .docx 文件所在的目录中。
我正在使用 Windows 8 和 Cygwin。如果答案需要代码(makefile?),我希望语言是 Lisp(显然,我不是程序员)。
我该怎么做?
基于:Converting all files in a folder to md using pandoc on Mac
我认为应该是:
find ./ -iname "*.docx" -type f -exec sh -c 'pandoc "[=10=]" -o "${0%.docx}.md"' {} \;