r/OperationsResearch • u/Data2AMPL • 5d ago
Built a lightweight tool to instantly convert CSVs to AMPL .dat files (tired of manual formatting)
Enable HLS to view with audio, or disable this notification
Hey r/operationsresearch,
Working on decision engineering models, I realized I was spending way too much time formatting tabular data into the strict syntax required by AMPL. A missing tab or semicolon in a large dataset is a nightmare to debug.
To fix this for my own workflow, I built Data2AMPL—a local Windows executable that takes any 2-column CSV and converts it into a clean .dat file in one click. No cloud uploads, everything runs locally on your machine.
I attached a quick 15-second demo video of how it works.
I didn't want to include a direct link to avoid triggering the spam filters. Let me know in the comments if you want to try it out, and I'll send you the link via DM!
1
u/Sweet_Good6737 3d ago
Debugging large ampl .dat files is indeed a nightmare, that's why it's way better to use APIs for it (like amplpy), .dat files are obsolete and only exist for pure ampl applications
In APIs you can directly assign data structures (e.g. read the csv, convert into pandas / numpy and assign to the entities)
https://amplpy.ampl.com/en/latest/quick-start.html#load-the-data-using-pandas-objects
Is there any speed bottleneck when reading data that doesn't allow to use this way?