Problems converting from excel to dataset

Dear all,

I am having problems using the function provided by @JordanCClark

The function was working nicely, but I do not know how to solve this:

  • I am trying to create a dataset from the sheet 1 of an excel document. What is more, I want to be the first row (headers in the converted dataset) the index number 9 in the image:

Therefore, I just modified inside the function the index of the sheet and the firstRow index:

sheet = wb.getSheetAt(1)

firstRow = 8

PS: I tried changing lastRow to i.e. 12 and it works.
PS2: It looks like the excel file has many blanks (please find attached an example of the document)
PS3: I have tried with other different formatted “large” excel (770 rows and 12 columns) and it works.
Test.xlsx (281.4 KB)

Thanks in advance guys,

The rows have differing numbers of columns and a huge amount of blank rows underneath. Once a cell is touched (for example a value put in, then erased, the cell stays touched).
I modified the script, adding options to select first/last rows and first/last columns

After the additions the data would import using:

ds = util.excelToDataSet(fileName, 
                         hasHeaders = True,
                         sheetNum = 1, 
                         firstRow = 8,
                         lastRow =  756,
                         lastCol = 9)

Thank you!! Nice @JordanCClark