Skip to content

Commit e352039

Browse files
committed
fix #286
1 parent 76568f7 commit e352039

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

xlsx2csv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
48: '##0.0e+0',
121121
49: '@',
122122
}
123+
EXCEL_ERROR_VALUES = [
124+
'#N/A', '#REF!', '#DIV/0!', '#CALC!', '#NAME!', '#NULL!', '#NUM!', '#SPILL!', '#VALUE!'
125+
]
123126
CONTENT_TYPES = set((
124127
'shared_strings',
125128
'styles',
@@ -862,7 +865,7 @@ def handleCharData(self, data):
862865
elif self.colType == "n":
863866
format_type = "float"
864867

865-
if format_type and not format_type in self.ignore_formats and self.data != "#N/A":
868+
if format_type and not format_type in self.ignore_formats and self.data not in EXCEL_ERROR_VALUES:
866869
try:
867870
if format_type == 'date': # date/time
868871
if self.workbook.date1904:

0 commit comments

Comments
 (0)