Ask HN: How would you chunk a large Excel file?
21–30 of 49 posts
Re: Ask HN: How would you chunk a large Excel file?
#22Re: Ask HN: How would you chunk a large Excel file?
#23You can use my SQL spreadsheet app: https://superintendent.app I had a similar problem at work where I needed to do some formula on a 5 GB CSV file. Excel can't handle more than 1M rows. Database through command line is too clunky. I did try to split the CSV into multiple files before but using formula on top of multiple files isn't easy. Eventually I built a Desktop GUI wrapper on SQLite, and it grew into Superinten…
This looks great. Well done.
Re: Ask HN: How would you chunk a large Excel file?
#24If you're worried about data not fitting in memory, then stream the file. It seems like the Java API has support for this, surely other languages do too.
Re: Ask HN: How would you chunk a large Excel file?
#25Re: Ask HN: How would you chunk a large Excel file?
#26It's been well over a decade since I last dealt with Excel, but I remember you could actually query the data with SQL without opening the file, like you would with any flat-file db. If the size is the problem. It was poorly documented but I'd done it a few times and it worked really well. The best part being it was simple, fast and worked even with locked files. Otherwise I don't understand the question.
Re: Ask HN: How would you chunk a large Excel file?
#27Re: Ask HN: How would you chunk a large Excel file?
#28Opening and working on an excel file with a few million rows can need a bit more ram than anticipated especially based on it's size/complexity.
The quickest way I'd start with is to convert it to a CSV, read the file in, and rewrite it out 500 lines at a time.
Re: Ask HN: How would you chunk a large Excel file?
#29Re: Ask HN: How would you chunk a large Excel file?
#30Xlsx or xls?
If it’s xlsx, stream the file, chunking 500 rows into each new file, watching for ref A1, then injecting that into previous files.
The xlsx format is a zip file of xml, not so bad to work with once you start.
I should note, this works best if you don’t care about the order of the rows. They technically aren’t required to be in order (I think).