[NTLUG:Discuss] bash question

Allen Flick allenflick at home.com
Thu Sep 13 12:04:02 CDT 2001


I do Tcl.  Very easy to understand even if I took out my comments.
Done under Win2k

--
  :^)  Allen Flick  (ALF)
===========================

#
# Change to appropriate directory and get list of
# .pdf files therein
#
cd c:/documents/pdf2text
set filelist [glob *.pdf]

# For each .pdf file found in this directory
#
foreach filename $filelist {
         #
         # replace each blank with a dash
         # and change the extension to txt
         #
         regsub -all " " $filename "-" newname
         regsub -all "\.pdf" $newname "\.txt" newname
         #
         # copy the pdf file to a .txt extended file
         #
         file copy -force $filename $newname

         # ------------------------------------
         #  Do what's necessary to convert the new
         #  .txt file to actual text.
         #    ??????  Whatever
         #
         pdftotext $newname
}





More information about the Discuss mailing list