Created
September 30, 2015 10:06
-
-
Save kerin/925de8b57aca5dac40c6 to your computer and use it in GitHub Desktop.
simple bash script to convert .docx to .md, .html and .txt with pandoc
This file contains hidden or 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
#!/usr/bin/env bash | |
find $1 -type f -name "*.docx" -print0 | while IFS= read -r -d $'\0' FNAME; do | |
BNAME=$(basename "$FNAME" .docx) | |
DNAME=$(dirname "$FNAME") | |
echo "$FNAME" | |
pandoc -t commonmark -o "$DNAME/$BNAME.md" "$FNAME" | |
pandoc -t html -o "$DNAME/$BNAME.html" "$FNAME" | |
pandoc -t plain -o "$DNAME/$BNAME.txt" "$FNAME" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment