I need to import data from a table in Excel in a 2 dimensional array.

I have this table in Excel

\--A--B--C

K--1--2--5

L--3--5--5

M--2--3--4

and I want to put the data in the array VALUE(COLUMN, ROW), ho can I do that?

I've found the solution only for one dimensional column using themmodbc module.

Thanks!

Nicola

Hi Nicola,

I am reading two dimensional array in the following way

Range 1 will be elements of row

Range 2 will be number of elemnets in column . these are ranges and not set

declarations

DenseData2: array(Range 1, Range 2) of real

DestNames2: array(Range 1) of string

end-declarations

Name a range for the data you want to read for e.g. in your example it will be from A -4

initializations from "mmodbc.excel:skiph;noindex;"+DATAFILE

DestNames2 as "[Sheet name$](Name of Rows (i.e K L M in your sheet)"

DenseData as 'Name of Range'

end-initializations

forall(d in Range 1,t in Range 2)do

Value(Row(d),Column(t)):=DenseData(d,t)

end-do

Row(d) and Column(t) will give you set elements

I hope this helps.

Vidit