A
Analogy Analogy
I'm reading an excel file (text and numbers) with the intent of storing
the data in a 2D array.
Here's my code to read in the data (after opening the excel file):
line = '1'
array = []
while worksheet.Range("c"+line) ['Value'] do
row = []
for column in 'c'..'z' do
row <<worksheet.cells(line, column).text
end
line.succ!
array << row
My problem is that this works if the first two columns of the excel file
are empty (i.e. data starts in cell C1), but doesn't read the excel data
if it starts in the first or second row (i.e. cell A1). Anyone know how
I might be able to pull all my data into a 2D array no matter where the
data starts? Thanks!
the data in a 2D array.
Here's my code to read in the data (after opening the excel file):
line = '1'
array = []
while worksheet.Range("c"+line) ['Value'] do
row = []
for column in 'c'..'z' do
row <<worksheet.cells(line, column).text
end
line.succ!
array << row
My problem is that this works if the first two columns of the excel file
are empty (i.e. data starts in cell C1), but doesn't read the excel data
if it starts in the first or second row (i.e. cell A1). Anyone know how
I might be able to pull all my data into a 2D array no matter where the
data starts? Thanks!