Automate CSV Import/Exports without Models

Monique_21913
Monique_21913 Altair Community Member
edited August 2022 in Community Q&A

If I open Monarch, load a CSV without a model and export it it to Excel, it works perfectly right out of the box.   Headers, field types - everything is perfect.    I'd like to do this using automation.    The problem is that, if a model isn't defined, nothing is output.

Of course I can do this with libraries and other products and heavy lifting but Monarch is already doing it perfectly.   My objective is to be able to just use Monarch as a CSV to Excel converter that makes the header a little nice and preserves our customer numbers (which Excel always butchers).

Any workaround ideas?

Answers

  • Zhanna Abidor_20687
    Zhanna Abidor_20687
    Altair Employee
    edited August 2022

    Hello Monique, 

    If you save the model when loading the csv into Monarch , you will be able to use that models into the Server library and automate it by including that model into the Standard or Visual process.  

    Loading delimited data into the rows and columns in Monarch does not mean that model does not exist. You can define the features of the model like delimiter and text identifier and save all of that into a model. So, model does exist and can be used in Automation. 

     

  • Monique_21913
    Monique_21913 Altair Community Member
    edited August 2022

    Hello Monique, 

    If you save the model when loading the csv into Monarch , you will be able to use that models into the Server library and automate it by including that model into the Standard or Visual process.  

    Loading delimited data into the rows and columns in Monarch does not mean that model does not exist. You can define the features of the model like delimiter and text identifier and save all of that into a model. So, model does exist and can be used in Automation. 

     

    Thanks for the reply.  I was hoping to open a CSV file without a model.   I have table driven automation that allows me to set the model, filter, project, etc, however I need a record for each import file.   I was hoping to use Import Database to import *.csv and then directly export it to XLXS without a model definition.   That way I could use your automatic converter which works beautifully and preserves my long numbers and dates.   Please correct me if I'm wrong but it appears as though a model is required for automation.  

  • Steve_Caiels
    Steve_Caiels
    Altair Employee
    edited August 2022

    Hi Monique
    As Zhanna mentioned, a Monarch Classic Model will be created and can be saved for future use, but I believe the structure must remain the same in your new csv files.

    If your input csv files are changing, I think Data Prep Studio will do what you need.

    For example, if I have the following two input csv files:
    Format1.csv
    Field1,Field2,Field3
    1,2,3
    1,2,3
    1,2,3
    1,2,3
    1,2,3

    Format2.csv
    FieldA,FieldB,FieldC,FieldD
    a,b,c,d
    a,b,c,d
    a,b,c,d

    I copied Format1.csv to a static filename of input.csv and dragged that into Data Prep Studio and selected the following load option.

    image

    It create the file, as expected.

    image

    If I replace input with format2.csv and reload the workspace it will resync with the new structure.

    image

    This works manually using Desktop Data Prep Studio and can also be automated via a visual process in Automator if you wish.

    Regards,

    Steve.