-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there anyway to read top N rows ? #146
Comments
This would be a very interesting feature. |
I've build a library to do that, as long as not many cells using string it can do just that. https://github.com/eaciit/hoboexcel. It stream the data directly from excel. only shared strings is being extracted and partitioned into files to save ram |
Hi @shawnye, thanks for your issue, sorry for my late reply. I have made the function // read top 10 rows
rows, err := f.Rows("Sheet1")
if err != nil {
fmt.Println(err)
return
}
for rows.Next() {
count++
if count > 10 {
break
}
row, _ := rows.Columns()
for _, colCell := range row {
fmt.Print(colCell, "\t")
}
fmt.Println()
} |
Suppose there is big files containing 500,000 rows , I just want to read top 1000 rows, could you provide the method like
ReadTop(sheetName string, rows int) [][]string
, maybe you could use xml stream reading to save a lot of memory than I do withGetRows()
.Thanks.
The text was updated successfully, but these errors were encountered: