在Windows批处理Pandoc转换 [英] Batch processing Pandoc conversions in Windows

查看:380
本文介绍了在Windows批处理Pandoc转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows中使用Pandoc大量的HTML文件转换成降价,并已发现的如何做到这一点在Mac ,但试图运行在Windows PowerShell中以下时收到错误。

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 {} \;

有人可以帮我翻译这在Windows工作?

Can someone help me translate this to work in Windows?

推荐答案

要转换的文件夹中的递归试试这个(Windows提示命令行):

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 %.

这篇关于在Windows批处理Pandoc转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆