Skip to main content

Read and Write CSV Files

  • March 28, 2019
  • 4 replies
  • 435 views

User Support
AIMMSian
CSV files are a de facto standard for communication of data. AIMMS provides the libraries
code:
DataLink
and
code:
CSVProvider
for the serializing of CSV files.

In this article an example is provided for reading data from a CSV file.

4 replies

MathFour
AIMMS Partner
Forum|alt.badge.img
  • AIMMS Partner
  • 57 replies
  • May 2, 2019
It seems that you have to have a clean csv to use this. Is it possible to import a csv where the first "column" isn't used in the model?

For example, if I export a python/pandas dataframe as a csv, it has the index in the first column. How do I "skip" over this while reading it into AIMMS?

And, yes, I can turn it off in python, but I need it there for other things.

mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • May 3, 2019
@MathFour , does your CSV file have headers ? Then just do not refer to the header of the first column in your data map.

Forum|alt.badge.img+2
  • AIMMS Partner
  • 6 replies
  • February 23, 2021

I downloaded the example project and modified the komma\fourrows.csv demand in second line from 1000 to 1000.10 and when I run the procedure, it rounds the value when import it to AIMMS.

What I have to do to get it into AIMMS as 1000.10 ?


  • 0 replies
  • February 23, 2021

Hi Erika

Can I suggest to start using the new Data Exchange Library. This library offers a much more flexible and generic way of communicated data files. We are expecting it to become the standard going forward. 
 

See: 

 



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator