Loading

shell / pandoc 将文件夹中的文件批量转换 docx to md

FILES=*.doc*
for f in $FILES
do
  # extension="${f##*.}"
  filename="${f%.*}"
  echo "Converting $f to $filename.md"
  `pandoc $f -t md -o $filename.md`
  # uncomment this line to delete the source file.
  # rm $f
done
find ./ -iname "*.doc*" -type f -exec sh -c 'pandoc "${0}" -o "${0%.doc*}.txt"' {} \;
posted @ 2022-01-20 11:19  ZXYFrank  阅读(515)  评论(0编辑  收藏  举报