excel-streaming-reader
excel-streaming-reader copied to clipboard
Reading first row from first sheet before full file available?
Thank you for this library. Is it reasonable to expect this library to enable access to the first row in the first sheet, when the file is not yet completely available (still sequentially arriving)? Based on the nature of the error, it seems like the underlying ZIP might disallow this.
When I try the following, I get the resulting exception.
List<String> list = new LinkedList<String>();
InputStream in = <...>
try (
Workbook workbook = StreamingReader.builder().open(in)) {
Sheet sheet = workbook.getSheetAt(0);
Row r = sheet.getRow(0);
for (Cell c : r) {
list.add(c.getStringCellValue());
}
}
org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file: '<...>.xlsx'
at org.apache.poi.openxml4j.opc.ZipPackage.
This is not an issue in this library. The exception happens in java.util.zip.ZipFile
Understood. But it might be worthwhile to clarify to your audience that your streaming API cannot control whether any of its dependencies do non-streaming things (case in point), and that the memory and speed benefits of streaming may therefore be adversely impacted. For our use case, it meant we couldn't use this library. Nevertheless, thank you for making this library available. Kind Regards.
From: PJ Fanning @.> Sent: Wednesday, March 10, 2021 4:34 PM To: pjfanning/excel-streaming-reader @.> Cc: David Barron @.>; Author @.> Subject: Re: [pjfanning/excel-streaming-reader] Reading first row from first sheet before full file available? (#38)
This is not an issue in this library. The exception happens in java.util.zip.ZipFile
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/pjfanning/excel-streaming-reader/issues/38#issuecomment-796155436, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABIYKLTQSZNUP4SNH7IN6P3TC7QXZANCNFSM4Y4IYLVA.
https://github.com/pjfanning/excel-streaming-reader/issues/103#issuecomment-1068119418 - similar use case and my answer is applicable here too
@david5w did you find a way to fit your use case?
We have not.
From: Vinícius Lara @.> Sent: Tuesday, March 15, 2022 2:53 PM To: pjfanning/excel-streaming-reader @.> Cc: David Barron @.>; Mention @.> Subject: Re: [pjfanning/excel-streaming-reader] Reading first row from first sheet before full file available? (#38)
@david5whttps://github.com/david5w did you find a way to fit your use case?
— Reply to this email directly, view it on GitHubhttps://github.com/pjfanning/excel-streaming-reader/issues/38#issuecomment-1068344448, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABIYKLQIAKA5DUG7NFHJXPTVADMCHANCNFSM4Y4IYLVA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>