Batch processing Pandoc conversions in Windows

后端 未结 5 854
遥遥无期
遥遥无期 2020-12-10 08:11

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 attem

5条回答
  •  爱一瞬间的悲伤
    2020-12-10 08:33

    • Most of the answers here (for ... solutions) are for cmd.exe, not PowerShell.
    • mb21's answer is on the right track, but has a bug with respect to targeting each input file; also, it is hard to parse visually.

    The functionally equivalent PowerShell command is:

    Get-ChildItem -File -Recurse -Filter *.md | ForEach-Object {
      pandoc -o ($_.FullName + '.txt') $_.FullName
    }
    

提交回复
热议问题