Is it possible to get the datatype or format of a column or cell in a spreadsheet when you read it using cfspreadsheet
?
I am converting spreadsheet data from an excel spreadsheet to a database table. Thus far I just format everything as varchars, but it would be good if I could specify dates as dates and integers as integers.
Unfortunately, not using
cfspreadsheet
or the built in spreadsheet functions. They only return what is displayed, not the underlying values. However you could roll your own by tapping into the underlying POI workbook.A few things to keep in mind:
To do the processing, just grab the desired sheet and iterate through the rows and cells. As you loop through the columns, check the cell type and extract the raw value (ie date, string, number, ...)
Source: Busy Developers' Guide to HSSF and XSSF Features