# \[AMPL 25042\] "Error reading table"

**URL:** https://discuss.ampl.com/t/ampl-25042-error-reading-table/1089
**Category:** Google Group Mirror
**Created:** [May 6, 2024, 7:16pm UTC](https://discuss.ampl.com/t/ampl-25042-error-reading-table/1089 "2024-05-06T19:16:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Gonzalo\_Reneses](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@Gonzalo\_Reneses](https://discuss.ampl.com/u/Gonzalo_Reneses)
#### Post date: [May 6, 2024, 7:16pm UTC](https://discuss.ampl.com/t/ampl-25042-error-reading-table/1089/1 "2024-05-06T19:16:22Z")

</div>

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

 ![image.png](https://us1.discourse-cdn.com/flex019/uploads/ampl/original/1X/4da3e028f78561f1a2996e0babbf3d94fbd79d16.png)

[FinalMP.mod](https://discuss.ampl.com/uploads/short-url/fxaZx0m5YrYlmp9VO3FVmuvFJf8.mod) (2.64 KB)

[RedMadrid.dat](https://discuss.ampl.com/uploads/short-url/z49wmiQT0V285KVLlporO4NTz3J.dat) (1.05 KB)

[MadridRed.xlsx](https://discuss.ampl.com/uploads/short-url/o6nRkwq2Iu8EDdPYAPy1eMGklKv.xlsx) (308 KB)

---

<div class="post-metadata">

### Author: ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)
#### Post date: [May 7, 2024, 1:08pm UTC](https://discuss.ampl.com/t/ampl-25042-error-reading-table/1089/2 "2024-05-07T13:08:27Z")

</div>

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:

```auto
Could not find column 'Dn' in spreadsheet table header

```

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

---

<div class="post-metadata">

### Author: ![AMPL\_Google\_Group1](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@AMPL\_Google\_Group1](https://discuss.ampl.com/u/AMPL_Google_Group1)
#### Post date: [May 7, 2024, 1:09pm UTC](https://discuss.ampl.com/t/ampl-25042-error-reading-table/1089/3 "2024-05-07T13:09:55Z")

</div>

Your question has been moved to our new user forum at [discuss.ampl.com](http://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](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.)
