Skip to content

How to read XLSX from file and not wait it's entire download to process it #103

@oviniciuslara

Description

@oviniciuslara

Hey, I have a question. How can we process one XLSX file stored remotely, in this example as URL, without waiting the code to entire download it first? For large files it takes a long time.

Example:

InputStream is = new URL("https://filebin.net/qe5ynsl7ikmzap8a/LINEITEM_6M.xlsx").openStream();
Workbook workbook = StreamingReader
		.builder()
		.rowCacheSize(100)
		.bufferSize(4096) 
		.open(is); 
for (Sheet sheet : workbook) {
	System.out.println(sheet.getSheetName());
	for (Row r : sheet) {
		for (Cell c : r) {
			System.out.println(c.getStringCellValue());
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions