dataframe icon indicating copy to clipboard operation
dataframe copied to clipboard

ReadExcel data with headers not on row 1

Open Burtan opened this issue 3 years ago • 11 comments

Hey, how to read excel tables that don't have their headers on the first row? Many scientific applications export their data with printing device information into the first rows and then following with the actual data.

Burtan avatar Aug 01 '22 06:08 Burtan

Hi! readExcel API doesn't support this right now. Would skipRows: Int = 0 parameter work for you? For skipRows = 1 it'll read headers from the second row.

koperagen avatar Aug 01 '22 15:08 koperagen

Btw, what application do you use? Would be interesting to better understand the use cases :)

koperagen avatar Aug 01 '22 16:08 koperagen

A skipRows function would help. It's qPCR data from a thermo scientific machine. I'm testing some code to automate data evaluation in a pathology context.

Burtan avatar Aug 01 '22 18:08 Burtan

Hi! Try 0.9.0-dev-1079 with the fix

koperagen avatar Aug 02 '22 18:08 koperagen

Hey, it now correctly skips the given rows, but only takes the columns which are also present in the first row. Here is an example of my sheet. It now only reads Well and Well Position as headers.

Block Type 96-Well 0.2-mL Block            
Calibration Background is expired No            
...
Stage/ Cycle where Ct Analysis is performed Stage1, Step1            
User Name              
               
Well Well Position Omit Sample Name Target Name Task Reporter Quencher

Burtan avatar Aug 03 '22 06:08 Burtan

Oh, i see. You can specify column range as a workaround for now. readExcel(columns = "A:H") Meanwhile, ill commit the fix and hopefully it'll be published soon :)

koperagen avatar Aug 03 '22 11:08 koperagen

Thanks, this works!

Burtan avatar Aug 03 '22 13:08 Burtan

I think the first row after the header is skipped?

Burtan avatar Aug 05 '22 06:08 Burtan

I think the first row after the header is skipped?

Can't reproduce in a test. Can you send a minified example + code that reads it?

koperagen avatar Aug 05 '22 10:08 koperagen

Please try this project. The link expires after 7 days. Thanks! https://cloud.frederik-bertling.de/f/6ebb5bb52031407f9809/

Burtan avatar Aug 05 '22 14:08 Burtan

Hi!~~I'm not sure what's going on, but i can't even read this file. Also, when i open it in google sheets / libreoffice calc, i see this:~~

edit. Nevermind, file manager messed up files while unarchiving this rar

koperagen avatar Aug 10 '22 11:08 koperagen

I can confirm, it works now. Thanks!

Burtan avatar Sep 14 '22 09:09 Burtan