You can use any programming language to write a program that reads your data source and writes a .dat file in the proper format. You have to figure out how to write the program, however. The choice of language depends on which one you like best or which is most compatible with your project.
If you have unformatted files of data then it is also possible to use AMPL's "read" command to read some of the values into AMPL parameters (www.ampl.com/BOOK/CHAPTERS/12-data.pdf#page=21) though it is necessary to take some care to get this right.
Bob Fourer
From: am...@googlegroups.com [mailto:am...@googlegroups.com]
On Behalf Of varu...@gmail.com
Sent: Tuesday, April 29, 2014 3:57 AM
To: am...@googlegroups.com
Cc: 4...@ampl.com
Subject: Re: [AMPL 8514] Having trouble in writing the .dat file
I'd like to ask you if it is possible to write the .dat file in python in somewhat a similar way. I am trying to generate random numbers to the parameters and then put this stuff in xml. I want to know if its a good idea to be generating data for a .mod file using python. But I'm clueless about the link creation and capacity assignment stuff.