Large File Streaming
Memory-efficient processing of large Excel files using the streaming API with Consumer callbacks
🎯 Why Use Streaming?
Traditional Loading vs. Streaming
// ⚠️ Loads ALL rows into memory at once
sheet = Spreadsheet( "huge-file.xlsx" );
data = sheet.toArray(); // Could consume gigabytes of RAM
for ( row in data ) {
// Process each row
}// ✅ Processes rows one at a time
Spreadsheet().process( "huge-file.xlsx", ( row ) => {
// Process row immediately, then discard from memory
println( row );
});When to Use Streaming
🔧 How It Works
Technology Stack
Format
Technology
Memory Usage
Notes
Streaming Configuration
📚 API Methods
Method 1: Process File by Path
Method 2: Process Specific Sheet
Method 3: Process Loaded Workbook
💡 Examples
Basic Row Processing
Data Import to Database
Processing Specific Sheet
Type-Safe Data Processing
Filtering During Streaming
Streaming with Row Counter
Error Handling in Streaming
Chaining with Fluent API
🎭 Cell Value Types
Excel Type
BoxLang Type
Example
Formula Handling
⚡ Performance Considerations
Memory Usage
File Size
Traditional Loading
Streaming API
Processing Speed
Optimization Tips
🔄 Streaming vs. Traditional Loading
Comparison Table
Feature
Streaming
Traditional Loading
Decision Matrix
🔐 Best Practices
1. Always Use XLSX for Large Files
2. Process Data Immediately
3. Handle Errors Gracefully
4. Use Filtering Early
5. Monitor Progress for Large Files
🐛 Troubleshooting
Issue: OutOfMemoryError
Issue: Slow Processing
Issue: XLS Files Not Streaming
📖 Related Documentation
🎓 Summary
Last updated
Was this helpful?
