Empty rows after data get read anyway
Description
I have an excel file with five rows (including headers). When reading it with the ExcelProvider, I get one extra empty row. Is this the expected behavior?
Repro steps
-
Get the excel file
-
Run the following FSharp script:
#r @"..\packages\ExcelProvider.0.8.1\lib\ExcelProvider.dll"
open FSharp.ExcelProvider
[<Literal>]
let excelFilePath = "TestBook.xlsx"
type ExcelWorkbook = ExcelFile<excelFilePath>
let source = new ExcelWorkbook()
source.Data
|> Seq.iter (fun row -> printfn "%A" row)
Expected behavior
I expected the data to only include the rows with actual data on them.
Actual behavior
When printing the rows, I see one extra row which is empty.
Related information
- Windows 7 (x64)
- Excel Provider 0.8.1
I'm dealing with this bug everytime I use this library. Is this behaviour consistent as it seems? Is there any reason to not cut the last row?
HI. This seems to be consistent behavior, I am also getting it. I haven't looked in the code as yet to try and see what causes it. The only reason not to remove it is that it may be a breaking change for users who have written code depending on this quirk. It would be interesting to hear from other users how they would want this to be addressed.
I would expect this bug to be fixed as a breaking change (and appropriately noted in the release notes).
Currently, I'm doing a quick and dirty work around like this:
type File = ExcelFile<DefaultFilePath>
let file = File filePath
let count = file.Data |> Seq.length
file.Data
|> Seq.truncate(count - 1)