Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am primitive c++ programmer. I am looking for a code to read an Excel csv file.

thanks

What I have tried:

tried a few codes but not working
Posted
Updated 16-Jun-19 20:45pm

Start by deciding if you want an Excel file or a CSV file: they are not the same thing at all.
Excel files generally end with .XLS or .XLSX (two very different formats for "real" Excel files, the first is a proprietary binary format, the second is a zipped XML-based spreadsheet file created by Microsoft Excel version 2007 and later).
CSV are not Excel file, though Excel can read and write them - they are very basic row based database with columns within each row separated by commas.

The latter is very easy to read: just read each line and split it by comma (though it can get more complex, as double quotes can be used to enclose strings which may contain commas, and the separated doesn't have to be a comma)
The former is a lot more complex to read regardless of XLS or XLSX extension!

Google for your required file type and "read C++" and you should find numerous examples already written for you.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900