You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not familiar with rust and having some problems with this proj.
Sometimes an integer in a table is incorrectly converted to a floating point number.
Are there future plans to provide a string-only schema without data conversion?
Also, can I skip the empty lines in the middle of the sheet?
Sometimes an integer in a table is incorrectly converted to a floating point number.
All numbers in Excel are stored as floats, so it's hard to detect the type of number with 100% success. Could you give an example file with this problem?
Also, can I skip the empty lines in the middle of the sheet?
I don't think this is exactly accurate. As I understand it, all Excel values are stored as plain text in XML files, then the calamine read engine parses the text and interprets it accordingly (see datatype.rs). That is, although strings are handled directly1, Excel's numeric values don't have meaning (int or float) until the engine interprets them during reading.
Excel Example
Click to show initial Excel file set-up
Input data
Create a new spreadsheet and put the following in A1:B5 (or just copy-paste the table below).
Data value
Notes
Dog
a string
Cat
a string
123
an integer
123
an integer
3.14
a float
Content summary:
7 strings: 'Data value', 'Notes', 'a string', 'a string', 'an integer', 'an integer', 'a float'
5 unique strings: 'Data value', 'Notes', 'a string', 'an integer', 'a float'
2 numeric values: 123, 3.14
Explore the file contents
Click for instructions on seeing an Excel file as XML
Change the Excel file extension to .zip (on a Windows device). Now you can navigate through the file contents more easily. If you look in the /xl/worksheets/sheet1.xml file, you see the cells' content.
We can see that both the integer and float values are stored as plain text within the <v> tags; Excel doesn't differentiate between the two.
Footnotes
String values are stored in a dedicated file: /xl/sharedStrings.xml. Then, in worksheet files like sheet1.xml, the string values are referenced by an index number. Excel flags these cells as strings by using the t="s" attribute in the <c ...> tag. ↩
The s="1" attribute is just a reference to the cell's style, which is defined in /xl/styles.xml. It doesn't affect the value of the cell. ↩
Activity
dimastbk commentedon Nov 2, 2024
Hi.
All numbers in Excel are stored as floats, so it's hard to detect the type of number with 100% success. Could you give an example file with this problem?
No, and I don't have a plan to add this feature.
B-D-T commentedon Aug 30, 2026
From @dimastbk:
I don't think this is exactly accurate. As I understand it, all Excel values are stored as plain text in XML files, then the calamine read engine parses the text and interprets it accordingly (see datatype.rs). That is, although strings are handled directly1, Excel's numeric values don't have meaning (int or float) until the engine interprets them during reading.
Excel Example
Click to show initial Excel file set-up
Input data
Create a new spreadsheet and put the following in A1:B5 (or just copy-paste the table below).
Content summary:
Explore the file contents
Click for instructions on seeing an Excel file as XML
Change the Excel file extension to
.zip(on a Windows device). Now you can navigate through the file contents more easily. If you look in the/xl/worksheets/sheet1.xmlfile, you see the cells' content.Show XML
The numeric values are in
row r="5"androw r="6", which are stored as shown below2:We can see that both the integer and float values are stored as plain text within the
<v>tags; Excel doesn't differentiate between the two.Footnotes
String values are stored in a dedicated file:
/xl/sharedStrings.xml. Then, in worksheet files likesheet1.xml, the string values are referenced by an index number. Excel flags these cells as strings by using thet="s"attribute in the<c ...>tag. ↩The
s="1"attribute is just a reference to the cell's style, which is defined in/xl/styles.xml. It doesn't affect the value of the cell. ↩B-D-T commentedon Aug 30, 2026
@Rex859619
If you're using polars read_excel in python, would using
drop_empty_rows = Truebe a solution for dropping your empty middle rows?(EDIT: actually, this might only work with the xlsx2csv engine. I'm not sure.)