Created
June 8, 2022 05:09
-
-
Save fferegrino/0b824b49488be32fc65affd29af855b5 to your computer and use it in GitHub Desktop.
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 | |
function dopptx { | |
source_folder=$(basename -- $1) | |
tmp_folder="${source_folder}_tmp" | |
slides_name="${source_folder%%_*}.pptx" | |
cp -r $source_folder $tmp_folder | |
find $tmp_folder -type f -name "*.xml" -exec sh -c "cat {} | xmllint --noblanks - | sponge {}" \; | |
find $tmp_folder -type f -name "*.rels" -exec sh -c "cat {} | xmllint --noblanks - | sponge {}" \; | |
cd ./$tmp_folder; zip -qq -r -X ../$slides_name * | |
cd ..; rm -rf ./$tmp_folder | |
} | |
for d in *_slides/ ; do | |
dopptx "$d" | |
done |
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 | |
function unpptx { | |
filename=$(basename -- $1) | |
source=$1 | |
folder="${filename%.*}_slides" | |
unzip -qq -o -d $folder $source | |
find ./$folder -type f -name "*.xml" -exec sh -c "cat {} | xmllint --format - | sponge {}" \; | |
find ./$folder -type f -name "*.rels" -exec sh -c "cat {} | xmllint --format - | sponge {}" \; | |
} | |
for i in `find . -name "*.pptx" -type f`; do | |
unpptx "$i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment