Exporting files thru .bat file

Altair Forum User
Altair Forum User
Altair Employee
edited October 2017 in Community Q&A

Hi:

 

 

I am writing a bat file that runs a txt file thru a model and then exports to a database. Syntax as follows:

 

cd "C:\Program Files\Monarch\program"

Monarch.exe "C:\Test\$$PXHCR4.PRN" "C:\Test\PXHCR4 Manhasset.dmod" "C:\Test\Test.mdb"

 

it works fine but I would like to modify so the export goes to an specific table. Any ideas?

 

FYI--we are using Monarch 7 to do this

 

Thanks,

 

Paola

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    Hi Paola,

     

    I suspect that what you want to do was introduced with Version 8.

     

    It also requires Monarch Pro.

     

    If you have a look in the Help file (I assume you will have in installed and accessible - as I recall it is installed by default) for Monarch Command Lines the options available should be listed.

     

    Without doing some digging into old machines and software disks the best I have readily available is a V10 help file that notes the

     

    /exptable:[Tablename]

     

    and a couple of associated commands having been introduced with V8.

     

    That said it also has some comments about what was available in "V6 and earlier" but V7 does not get a mention.

     

     

    I fear this may not help you much but take a look and see what you can find that offers guidance for V7.

     

     

    Grant

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    Hi Paola,

     

    I suspect that what you want to do was introduced with Version 8.

     

    It also requires Monarch Pro.

     

    If you have a look in the Help file (I assume you will have in installed and accessible - as I recall it is installed by default) for Monarch Command Lines the options available should be listed.

     

    Without doing some digging into old machines and software disks the best I have readily available is a V10 help file that notes the

     

    /exptable:[Tablename]

     

    and a couple of associated commands having been introduced with V8.

     

    That said it also has some comments about what was available in "V6 and earlier" but V7 does not get a mention.

     

     

    I fear this may not help you much but take a look and see what you can find that offers guidance for V7.

     

     

    Grant

    Thanks for your answer. We did not get to work. it look like we are quite limited giving the old Monarch version.

    Paola

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    Thanks for your answer. We did not get to work. it look like we are quite limited giving the old Monarch version.

    Paola

    I think if you had V8 not V7 you would have been able to use it.

     

    Current versions of Monarch no longer have built in Command Line support.

     

    The only suggestion I can think of, assuming you don't have a  Version 8, 9 or 10 copy of Monarch anywhere,  is to export to a file and then have a script that takes that file and loads it into the required table in the database.

     

    Others may have better suggestions for you.

     

     

     

    Grant

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    Thanks for your answer. We did not get to work. it look like we are quite limited giving the old Monarch version.

    Paola

    Hi Paola,

     

    Grant has a much better memory than me, but I think this might be a standard vs professional issue.

     

    Do you have the ability to save a project as well as a model in your version?  If you do, then I think you will get what you need from a project export. I can elaborate if it is relevant.

     

    Regards,

    Steve.

     

    Get Outlook for iOS<https://aka.ms/o0ukef>

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    Hi Paola,

     

    Grant has a much better memory than me, but I think this might be a standard vs professional issue.

     

    Do you have the ability to save a project as well as a model in your version?  If you do, then I think you will get what you need from a project export. I can elaborate if it is relevant.

     

    Regards,

    Steve.

     

    Get Outlook for iOS<https://aka.ms/o0ukef>

    Hi Steve,

     

    Not a good memory Steve - just reading the Help documentation for V10.5!  The back history for the Command Line functionality is documented there. Very useful for those who used automation when they were upgrading.

     

     

    Grant

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    Thanks for your answer. We did not get to work. it look like we are quite limited giving the old Monarch version.

    Paola

    Paola,

     

    When you say you did not get it to work  - that is what I would expect based on the documentation I have found. The /exptable option was new for V8.

     

    However, are you saying you tried the command extension in V7 to see what might happen? If so, what did happen?

     

    There is a second command that also needs to be employed to tell the process what to do in the even that the target table already exists.

     

    Steve mentions the use of a Project definition to configure the output and that sounds like good sense to me but I cannot recall whether V7 projects managed exporting to tables within a database. I suspect they did not since that would require the same functionality as the Command Line process. However you should be able to check that very easily.

     

    Grant

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017
    Thank you so much Grant and Steve. Unfortunately we ran through a registry issue with the computers and are trying to address it with IT. Were able,  to export some tables and test the bat file(everything in the C drive) before IT took the writing rights for our machines away.

     

    We do have Monarch 7 Pro so we can create projects. The issue with the export was that there are 4 tables that get exported to the same database and because we are unable to specify the name of the table every time we export a different table to the same database, the existing table in the database is replaced by the new one. We have to do this for 6 different sites (so 24 times). We did tried the command  /exptable: but I can't recall the error we got ( I can't double check, neither, since my writing rights to the C drive got taken away).

     

    Given the high scrutiny and regulations from IT, we are considering switching to Monarch 13 and getting the export features (I understand is a separate feature that comes with a separate cost). Do you know if that will eliminate all these constrains and will make the automation (ability to load a text file, run model and export to specific databases and tables in Ms Access) smoother?

     

    Thanks ,

     

    Paola

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    Thank you so much Grant and Steve. Unfortunately we ran through a registry issue with the computers and are trying to address it with IT. Were able,  to export some tables and test the bat file(everything in the C drive) before IT took the writing rights for our machines away.

     

    We do have Monarch 7 Pro so we can create projects. The issue with the export was that there are 4 tables that get exported to the same database and because we are unable to specify the name of the table every time we export a different table to the same database, the existing table in the database is replaced by the new one. We have to do this for 6 different sites (so 24 times). We did tried the command  /exptable: but I can't recall the error we got ( I can't double check, neither, since my writing rights to the C drive got taken away).

     

    Given the high scrutiny and regulations from IT, we are considering switching to Monarch 13 and getting the export features (I understand is a separate feature that comes with a separate cost). Do you know if that will eliminate all these constrains and will make the automation (ability to load a text file, run model and export to specific databases and tables in Ms Access) smoother?

     

    Thanks ,

     

    Paola

    The registry issue prompts the message: Cannot open file MFWFIL32.DLL file is missing or version is incorrect

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2017

    The registry issue prompts the message: Cannot open file MFWFIL32.DLL file is missing or version is incorrect

    Paola,

     

    From memory this is a sort of Windows Update/Version/Application compatibility issue.

     

    As I said previously I would doubt that V7 will like the command as the documentation I have been able to see so far refers to it as a feature added in V8.

     

    Monarch V14.2 is the current release (unless Datatwatch have release another without me noticing)

     

    The Export features are part of Monarch but the AUTOMATION features - the equivalent of your batch process using Command Line Instructions - are these days handled differently and require a separate license. On the plus side there are features available that should keep the security people in your IT department happy!

     

     

    HTH.

     

     

     

    Grant