2 Replies Latest reply: May 15, 2014 10:03 AM by Ann Casey RSS

    Processing large volume of files at command prompt

    Ann Casey

      Hi there

      I am trying to process large volume of files udsing command prompt.

      I have created a dos batch file which loops thru a number of pdf files.

      My initial problem was to process 47 files - I managed to break these up logically within the for statement so that I had only 4 batch files to run.  This was manageable and worked.  Example of one of batch files.

       

      FOR /F %%X IN ('dir /b *interactive.pdf')

      DO start monarch.exe "d:\%%X"

      /mod  "d:\final.xmod"

      /exp:"d:\%%X.csv" /T

       

       

      However, now I have to process 1240 pdf files.  Even by using the method I had previously by controlling the logic of the for loop, I would still need to run a very large number of dos bat files.  The question is, how could I best achieve this ?  Is there a maximum  number of files that can be processed in this way.  Can anyone suggest a way to process this large no of files ?

       

      Thanks

      Ann

        • Processing large volume of files at command prompt
          Nick Osdale-Popa

          This is a batch file I created some time ago that will process all .PRN files in a given folder, regardless of the number of files:

          @echo off

          For %%i in (*.prn) Do Call :DoMonarch "%%i"

          GOTO :EOF

          :DoMonarch

          ("C:\Program Files\Monarch\Program\Monarch.exe" /rpt:"%1" /mod:"Model.xmod" /exp:"C:\Folder\DataExport.xls" /T /exptable:"%1" /expfileopt:add)

          GOTO :EOF[/CODE]

           

          I realize this is still very similar to your routine. Are all your .PDFs in one folder or are they in separate subfolders? If the latter, just add a /s to the DIR command to process them. I don't foresee any problems using this technique.

           

          EDIT:

          If you change the 

          /exp:"C:\Folder\DataExport.xls"[/B]

          to 

          /exp:"C:\Folder\[I]%~n1.csv[/I]"[/B]

          you'll actually get CSV files that have the same name as your input file. Thus if your PDF is 12345.PDF[/U], the csv file name will be 12345.CSV[/U].

           

          Hope that helps!