Created
February 24, 2018 00:12
-
-
Save spagu/5e2f3c95296dacb774bf530672670b5f to your computer and use it in GitHub Desktop.
Script to convert DOCX to HTML using bash and 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
#!/usr/bin/env bash | |
# use: ./docx-to-html.sh /folderpath/ | |
find $1 -type f -name "*.docx" -print0 | while IFS= read -r -d $'\0' FINALNAME; do | |
BASENAME=$(basename "$FINALNAME" .docx) | |
DIRNAME=$(dirname "$FINALNAME") | |
echo "$FINALNAME" | |
pandoc -t html -o "$DIRNAME/$BASENAME.html" "$FINALNAME" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment