The easiest way would be to use DataPump, which was designed for this sort of job, but there may be a way around it.
would direct the listing of all the required input files into a new text report.
You can then use Monarch to open this report, and it's fairly easy to define a calculated field of the form:
(Watch out to use chr(34) for " in the expression.)
Then output this from Monarch as a fixed width text file called "newbatch.bat" and call it from your original batch file.
You could do something like this in one batch file:
For %%i in ("C:\FullPath\x230*.txt") Do Call :monarch "%%i"
"C:\Program Files\Monarch\Program\Monarch.exe" /rpt:%1 /pxall
This effectively does the same thing that Olly's NewBatch.bat routine would do, without the extra steps of running Monarch first.
I was working with Data Kruncher through PM and it's come to my understanding that what you want to do is run all reports against the project file. To that end I came up with a better solutions to the problem:
for %%i in ("C:\FullPath\x230*.txt") do (set reports=!reports! /rpt:%%i)
"C:\Program Files\Monarch\Program\Monarch.exe" /prj:bc_era_BPR_extract.xprj %reports% /pxall
This will put all files into the reports environment variable that is then passed to Monarch.
I had a slightly different idea for this one: still a batch file, but I wanted to have the batch file build up the Monarch command line automatically.
I struggled to get the syntax right, so, via PM, our resident batch file expert Nick kindly sorted it out to yield what I was attempting to accomplish, which is:
See above: he beat me to posting it.
Nick, you da man.