Load Simulator Progam from .csv file programmatically

I am trying to create a new simulated device, then import the program for the simulation using a .csv file. I am currently doing this manually form the gateway webpage, but I would like to be able to do this in a script. Is that possible?