I know that we can use Apache POI to parse an Excel file and get data. But I heard of a strange thing that excel file can be passed in a similar way we parse CSV (Like just read the file from file Stream and separate each column value with a "comma" separator). When we parse Excel we have to use tab as a delimiter. Is it possible? If yes then why Apache has come up with such a complicated framework. I am puzzled. Can someone help me?
To read data from Excel cells, use the Excel runtime object. In some advanced cases, for instance, when you work with ranges of cells in Excel files, you can use the Excel. Application COM object.
Save this answer. Show activity on this post. Yes, it works without Excel application in your VM.
CSV is a text format, so it can be parsed using the delimiters. Old Excel is a binary and proprietary format so it needs clever decoding. The new Excel format is zipped XMLs, but one should also understand the structure of this document before it could be transformed into something as simple as reading cells one by one. So the answer to your question is no, you'll need to use Apache POI, and also - there's nothing wrong with that.
As a side note, on the path to become a good developer you will need to learn to do a bit of your own research before looking for help. Get your hands dirty is the best way to learn things.
You've probably confused what you've heard, or the person telling you was confused.
Some parts of Excel files can be stored (somewhat) as CSV files as the tabular data structure fits well within a CSV file format. However, if you save in CSV format then you just get plain text in each cell - you lose all formatting information, any graphs, multiple worksheets and so on.
The native XLS excel format is what Apache POI works with, and so can handle everything in excel, not just restrictive plain text in certain cells. CSV files have their uses but they're definitely not a straight replacement for normal Excel files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With