brechtsanders / xlsxio

XLSX I/O - C library for reading and writing .xlsx files
MIT License
418 stars 112 forks source link

Determine cell type #12

Open Maxxan opened 7 years ago

Maxxan commented 7 years ago

It would be very useful to be able to question what cell type something is, if it should be used as a string, number or date, for example to know if xlsxioread_sheet_next_cell_float or some other function should be called.

brechtsanders commented 7 years ago

Hi, Good suggestion. At this time the library just reads data. To know the cell type it will be necessary to keep track of column and row attributes and then check if the cell has a type or inherits it. I did not intend to do all this, but I will add it to the wish list. Regards Brecht

Maxxan commented 7 years ago

I made some modifications to the library to support data types. I could email the file to you and you can see if you want to add it or not.. Then I don't need to make a pull request. :)

brechtsanders commented 7 years ago

I would be glad to have a look at you modified code. And if it's good I could include it.

Maxxan commented 7 years ago

Here you are. I fixed a lot of POSIX naming problems as well that generated a lot of warnings. xlsxio.zip As you see, I used another library as well for hashmap and array support, but you can do as you want with that. Maybe use an internal solution.

And if you decide to add it, then it should be added to the callback version of reading as well.

brechtsanders commented 7 years ago

Why did you switch from stricmp to _stricmp? In my experience stricmp is more portable, and platform portability remains an important goal of the project. Which platform are you on exactly?

Maxxan commented 7 years ago

Mostly it was due to Visual Studio 2015 giving heaps of warnings about it. :)

sohguanh commented 6 years ago

May I know this determine cell type feature is available in the latest release? It is quite important as we need to know the datatype before we know which api method to call.

brechtsanders commented 6 years ago

This feature is not trivial to implement, and has not been added yet.

damian-m-g commented 5 years ago

Hi guys. Do we have any chance to see this implemented soon? Do you have any workaround for this?