>>514979938
I finished a small powershell script to loop thru directorys and count pdf pages wheeeee
have to download PDFINFO.EXE available everywhere
.
.
#
# dbs25 digital bookshelf
# powershell -file dbs25.ps1
# use | more for output
# or 1>zz1.txt 2>zz2.txt
#
# many corrupt pdfs
# pdfinfo.exe spewing errors
set-psdebug -trace 0
$global:numfiles = 0
$global:numpages = 0
function process_directory ($dirpath)
{
$nf = 0
$np = 0
get-childitem $dirpath | foreach-object {
$fn = $_.fullname
if ( $fn -like "*.pdf" ) {
$nf += 1
$pl1 = (.\pdfinfo $fn | select-string -pattern '^pages:')
$pl1 = $pl1 -replace 'pages: ',''
$np += [int]$pl1
#write-host ">>>file" $fn "pages" $pl1
}
else {
write-host $fn "not .pdf"
}
}
write-host "directory" $dirpath "files" $nf "pages" $np
write-host
$global:numfiles += $nf
$global:numpages += $np
}
# get-executionpolicy
set-executionpolicy remotesigned
write-host ">>>begin processing"
process_directory "c:\\aaareads\\boardgames"
process_directory "c:\\aaareads\\espionage"
process_directory "c:\\aaareads\\kkk"
write-host "total files" $global:numfiles "total pages" $global:numpages
write-host ">>>end processing"
#
# dbs25 digital bookshelf
#