9 Replies Latest reply: May 15, 2014 9:55 AM by Bruce _ RSS

    "/exptableopt"

    jgould81 _

      I am hoping this is an easy one.  I am just trying to get the correct syntax for the "/exptableopt" parameter.

       

      I need to pull data from 2 different files and combine them together in the export file.  SO far I have been unsuccessful at this..

       

      Can someone please give me an example?

       

      Thanks

        • "/exptableopt"
          Data Kruncher

          The syntax you need to supply for this parameter is either /exptableopt:overwrite[/b]  or  /exptableopt:append[/b] or exptableopt:skip[/b] depending on your requirements.

           

          As you're trying to combine data, I suspect that you want to use the append keyword.

           

          Does this get you any further ahead? If not, it would be helpful to see your full script.

           

          Kruncher

          • "/exptableopt"
            jgould81 _

            I run the first line to create the file:

            c:...monarch.exe /rpt:"Z:...File1" /mod:"C:...Model.xmod" /exp:"c:...ExportFile.xls" /t

             

            Then this line to add to the file just created

             

            c:...monarch.exe /rpt:"Z:...File2" /mod:"C:...Model.xmod" /exp:"c:...ExportFile" /t /exptableopt:append

            • "/exptableopt"
              Data Kruncher

              Monarch versions 7 and later aren't particular about the sequence of the parameters supplied, so we can rule out the possibility that the parameter sequence is causing problems.

               

              While I'm sure that the example you posted isn't exactly[/i] what your script has, you might want to make sure that you've got a ".xls" on the second filename as that is missing in your sample.

               

              As well, open one of the reports and the model and confirm that you're defined the export option for XLS files to be the most compatible version for whichever version of Excel you have installed (presumably Excel 97+).

               

              Does the append work properly if you do it manually (File Export...)?

              • "/exptableopt"
                Data Kruncher

                OK, even after my last post I was curious as to what was really wrong with this. A search of the forum came up with similar situations where the /exptableopt just didn't seem to be doing what it was meant to do.

                 

                So instead of relying on just what the online helps says the parameters should be, I broke down and built my own batch file. Guess what? I couldn't make it work. My tests kept overwriting the file instead of appending to it, no matter what I tried.

                 

                Then I tried  [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=001154;p=1#000004"]a method suggested by Todd[/url]. Success! The append worked!

                 

                So the big question then is "What's the secret to /exptableopt?"

                 

                Anybody? Have you managed to get a batch file to work using /exptableopt?

                • "/exptableopt"
                  Gareth Horton

                  Hi

                   

                  I could be wrong, as I cannot test it at the moment at my machine is tied up, but I imagine you need to specify the "table" or worksheet name you are appending to, unless you are using an Excel format so old that it does not support multiple sheets.

                   

                  You probably need to add this argument to the command line.

                   

                  /exptable:[Tablename]

                   

                  Gareth

                   

                  Originally posted by Data Kruncher:

                  OK, even after my last post I was curious as to what was really wrong with this. A search of the forum came up with similar situations where the /exptableopt just didn't seem to be doing what it was meant to do.

                   

                  So instead of relying on just what the online helps says the parameters should be, I broke down and built my own batch file. Guess what? I couldn't make it work. My tests kept overwriting the file instead of appending to it, no matter what I tried.

                   

                  Then I tried  [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=001154;p=1#000004"]a method suggested by Todd[/url]. Success! The append worked!

                   

                  So the big question then is "What's the secret to /exptableopt?"

                   

                  Anybody? Have you managed to get a batch file to work using /exptableopt? /b[/quote]

                  • "/exptableopt"
                    Data Kruncher

                    In my testing, this appends properly:

                    [font="courier"]"C:Program FilesMonarch Pro V8ProgramMonarch.exe" "C:TestProject.xprj" /px:"Mytest"[/font][/quote]but this overwrites the worksheet:

                    [font="courier"]"C:Program FilesMonarch Pro V8ProgramMonarch.exe" /rpt:"H:MyReport.txt" /mod:"H:MyModel.xmod" /exptable:"Mytest" /exptableopt:append /exp:"C:Mytest.xls"[/font][/quote]as does:

                    [font="courier"]"C:Program FilesMonarch Pro V8ProgramMonarch.exe" /rpt:"H:MyReport.txt" /mod:"H:MyModel.xmod" /exptable:"Mytest" /exptableopt:"append" /exp:"C:Mytest.xls"[/font][/quote]There is only one worksheet in the test workbook, and the model is set to export to Excel 97+.

                     

                      :confused:

                    • "/exptableopt"
                      Data Kruncher

                      Aha! Thanks for solving this mystery Ken.

                       

                      In reviewing the help entry for the command line parameters, it certainly isn't crystal clear that /expfileopt is required when using /exptableopt.

                      • "/exptableopt"
                        Mike Rainey

                        I can't get this to work. I've tried all the suggestions here and I can't get a report's data to append to an Excel Spreadsheet. I can export the data from another report to create the spreadsheet, but can't append to it through Monarch using the command line. Here is the line that exports the data to append:

                         

                        <<DIRECTORYPATH>>MONARCH.EXE /rpt:<<REPORTSPATH>>1500_Forms_%mm%%dd%%yy%.txt /mod:<<MODELPATH>>BARClaimError.xmod /expfileopt:add /exptableopt:append /exp:<<REPORTSPATH>>BARClaimErrorReport%mm%%dd%%yy%.xls /T

                         

                        If I watch it run, it flashes the window like its going to append, but I can see "=Export Failed" in the window.

                         

                        %mm%, %dd%, %yy% are variables I'm using to get the date and add it to the file names.

                        • "/exptableopt"
                          Bruce _

                          I know this is an old post...but I think it might be related.

                           

                          I have a problem with using pxall when I have different export options. For instance I defined an export to Excel: ovewrite to existing file, add to existing table. Then I had another export, to Access, add to existing file, overwrite existing table.

                           

                          When I ran pxall from a batch file, the Excel exported worked fine, but the access export appended to the file (after clearing the prior records). I ended up with 3000 blank lines, then 3000 good lines.

                           

                          Using the Run All button from within Monarch works fine, as does using the px:exportname.