简体   繁体   中英

Possible to read an incomplete excel file?

I am currently using openpyxl to read the first 1000 rows of a very large (1GB) excel file. Is it possible to read excel data in openpyxl from an incomplete file? For example, if I only downloaded the first 10MB of the file instead of 1GB. Would there be any way to view the first 1000 of that (incomplete) file?

Currently I'm using:

from openpyxl import load_workbook
wb = load_workbook('BigFile.xlsx', read_only=True)
ws = wb.worksheets[0]

Though I'm open to using another library if it supports reading an incomplete excel file.

OOXML files are zip archives and, unlike gzip files, cannot really be streamed, ie. unpacked while still being transmitted. So, no, you cannot start reading the file while still downloading it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM