Last active
July 18, 2018 21:07
-
-
Save seventhsense/b353507fd08cb8733216de8bdd2999dd to your computer and use it in GitHub Desktop.
docxをmarkdownにまとめて変換するスクリプト(要pandoc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 同一ディレクトリ上のdocxファイルをmdファイルに変換する.元ファイルは残る. | |
# refer https://qiita.com/kinagaki/items/460577f46529484d720e | |
dir=`pwd` | |
list=`find ${dir} -type f` | |
for file in $list; do | |
filename=`basename $file` | |
ext=${filename##*.} | |
if [[ $ext == "docx" ]]; then | |
echo $filename | |
basename=${filename%.*} | |
`pandoc $filename -t markdown-raw_html-native_divs-native_spans -o ${basename}.md ` | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment