I found this implementation in JAVA, but I was wondering if it is possible to get the number of slides in a ppt file? If so, would it be similar to doing the same operation in pptx files?
-Look through the directory that the script file is in -Detect and count the number of slides in a ppt file -Take that number and append it to a CSV file
I found a bash script that will do something similar but for PDF files
#!/bin/bash
saveIFS=$IFS
IFS=$(echo -en "\n\b")
myFiles=($(find . -name "*.pdf"))
totalPages=0
echo "file path, number of pages" > log_3.csv
for eachFile in ${myFiles[*]}; do
pageCount=$(mdls $eachFile | grep kMDItemNumberOfPages | awk -F'= ' '{print $2}')
size=${#pageCount}
if [ $size -eq 0 ]
then
# these files had no entry for kMDItemNumberOfPages
# comment out the next line to not list these files
echo $eachFile : \*\* Skipped - no page count \*\*
else
# comment out the next line if you don't want to see a count for each file
echo $eachFile, $pageCount >> log_3.csv
totalPages=$(($totalPages + $pageCount))
fi
done
echo "Total number of pages, ${totalPages}" >> log_3.csv
echo Total pages: $totalPages
IFS=$saveIFS
Could we refractor this code to make it work with ppt files?
Thanks!