Created
February 25, 2020 12:13
-
-
Save knthls/e24428aae930417ca73e5defd271e2e6 to your computer and use it in GitHub Desktop.
Inspect document xml for docx file
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
#/bin/bash | |
wd=$(mktemp -d) | |
docx_file=$1 | |
if [ -z $docx_file ]; then | |
echo "Usage: inspect_docx.sh []" | |
fi | |
if [ -z $EDITOR ]; then | |
EDITOR=nvim | |
fi | |
if [ -f $docx_file ]; then | |
cp test.docx "$wd/test.zip" | |
unzip "$wd/test.zip" -d $wd | |
cat $wd/word/document.xml | xmllint --format - | $EDITOR | |
rm -r $wd | |
else | |
echo "no such file $docx_file" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment