# Inquiry for multidimensional data

**URL:** <https://discuss.ampl.com/t/inquiry-for-multidimensional-data/923>\
**Category:** Support\
**Tags:** general\
**Created:** [January 30, 2024, 2:35pm UTC](https://discuss.ampl.com/t/inquiry-for-multidimensional-data/923 "2024-01-30T14:35:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Millie](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/millie/32/629_2.png) [@Millie](https://discuss.ampl.com/u/Millie)\
**Post date:** [January 30, 2024, 2:35pm UTC](https://discuss.ampl.com/t/inquiry-for-multidimensional-data/923/1 "2024-01-30T14:35:49Z")

</div>

Hi supoort team! I tried to define a 3-dimensional parameter and I referred to the documentation ([https://ampl.com/wp-content/uploads/Chapter-9-Specifying-Data-AMPL-Book.pdf](https://ampl.com/wp-content/uploads/Chapter-9-Specifying-Data-AMPL-Book.pdf)) and decided to specify the values in two-dimensional slices following page 157 param cost.

I defined the param in .mod file as param tilde\_invest{k in K,i in I, t in T}; ( I believe I have clarified K, I, T in the file and data file)

However, I received this error tilde\_invest[22.2,1,3] already defined. I think 22.2 should be an element ( it’s the second element of one row) instead of an index and I am not sure what caused this problem. I attached the screenshot of my param.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/ampl/original/1X/562592c8b8693e60e349daecee76d81e7de3a021.png)  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/ampl/original/1X/b77af92d341b31dfb20e5d0c7088efffea2ba023.jpeg)

I used the excel and CSV files to help store my data and paste it directly to the .dat file. I don’t know if this causes this problem. Looking forward to hearing your advice.

---

<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:** [January 30, 2024, 10:49pm UTC](https://discuss.ampl.com/t/inquiry-for-multidimensional-data/923/2 "2024-01-30T22:49:57Z")

</div>

The usual cause of this kind of error is a missing number. Line 23 under `[*,*,3]` should consist of `23` followed by 20 data values. But if that line has only 19 data values, then AMPL will go to the next line and read `24` as the 20th value, and everything will be off by one after that.

If you can’t see a missing number in line 23, then to get more help, upload the whole data file (by clicking on Discourse’s upload icon).

(If you will be reading a lot of spreadsheet files, you may also want to check out the amplxl plugin for .xlsx spreadsheet files, or the amplcsv plugin for .csv files.)

---

<div class="post-metadata">

**Author:** ![Millie](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/millie/32/629_2.png) [@Millie](https://discuss.ampl.com/u/Millie)\
**Post date:** [January 30, 2024, 11:16pm UTC](https://discuss.ampl.com/t/inquiry-for-multidimensional-data/923/3 "2024-01-30T23:16:01Z")

</div>

Thank you for your reply! I checked the original CSV file and believe there is no missing number. I uploaded the .dat file and I see that the format is a bit messy after [_,_,3], which might cause the problem. While I haven’t found the exact problem and am not sure whether it’s handy to use amplcsv plugin based on the current data format. ( I have the data store exactly what I have here in the .dat file for each parameter.)

[test\_1.dat](https://discuss.ampl.com/uploads/short-url/l14zsCOosJjRz53WOmdEFRPRIBr.dat) (168.7 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:** [January 31, 2024, 4:56pm UTC](https://discuss.ampl.com/t/inquiry-for-multidimensional-data/923/4 "2024-01-31T16:56:25Z")

</div>

The file does look right when I view it in a plain-text editor. But when I take a closer look in a hex editor (I use HxD for Windows) I see something wrong: in the line that begins `[*,*,3]`, the : character is represented by 3 unicode bytes EF BC 9a (which represent something called a “fullwidth colon”):

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

These 3 bytes need to be replaced by the single byte 3A that represents : in ASCII code. The same problem occurs in several other lines. One way to fix it is to use a plain-text editor to delete and replace `20` `:=` in every line where it appears.

---

<div class="post-metadata">

**Author:** ![Millie](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/millie/32/629_2.png) [@Millie](https://discuss.ampl.com/u/Millie)\
**Post date:** [February 1, 2024, 12:29am UTC](https://discuss.ampl.com/t/inquiry-for-multidimensional-data/923/5 "2024-02-01T00:29:40Z")

</div>

Thank you so much for checking the file and providing clear instructions! It’s now solved!
