[AMPL 25042] "Error reading table"

Good afternoon.

I´m writing you in order to see if you could solve a strange error that AMPL has showed me.
Please find attached the screenshot and the proper documents. Also, note that the .mod works perfectly as I have already tested it with another .dat. In fact, that other .dat is the same as the RedMadrid.dat, the only thing that changes being the excel from which the data is extracted. Going even further, that excel is also defined exactly the same as MadridRed.xlsx, so I don´t get why it is showing me that error.
Lastly, FYI, if I remove the next two lines:

“table listaNodos IN “amplxl” “MadridRed.xlsx” “Nodos”: N <-[N], Dn;
read table listaNodos;”

the program doesn´t print any error reading any other table.

Thank you in advance,
Gonzalo

FinalMP.mod (2.64 KB)

RedMadrid.dat (1.05 KB)

MadridRed.xlsx (308 KB)

The spreadsheet entry in cell D3 has an extra space at the end: it is "Dn " rather than “Dn”. Thus “read table” does not recognize it as “Dn”, and you get this error:

Could not find column 'Dn' in spreadsheet table header

After this space is removed, all of your spreadsheet tables read successfully.

Your question has been moved to our new user forum at discuss.ampl.com, and a response has been posted there. To see the response, use this link:

https://discuss.ampl.com/t/ampl-25042-error-reading-table/1089/2

To reply, click the red “Reply” button that follows the response. (Do not send an email reply to this message.)