Skip to content

Commit 5ec807f

Browse files
committed
🐛 replace dot spliting with os.path.splitext. addressing #47
1 parent 6ad875c commit 5ec807f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyexcel_io/readers/csvr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ def _load_from_file(self):
332332
self.__line_terminator = self._keywords.get(
333333
constants.KEYWORD_LINE_TERMINATOR, self.__line_terminator
334334
)
335-
names = self._file_name.split(".")
336-
filepattern = "%s%s*%s*.%s" % (
335+
names = os.path.splitext(self._file_name)
336+
filepattern = "%s%s*%s*%s" % (
337337
names[0],
338338
constants.DEFAULT_MULTI_CSV_SEPARATOR,
339339
constants.DEFAULT_MULTI_CSV_SEPARATOR,
@@ -345,7 +345,7 @@ def _load_from_file(self):
345345
return [NamedContent(file_parts[-1], self._file_name)]
346346

347347
else:
348-
matcher = "%s%s(.*)%s(.*).%s" % (
348+
matcher = "%s%s(.*)%s(.*)%s" % (
349349
names[0],
350350
constants.DEFAULT_MULTI_CSV_SEPARATOR,
351351
constants.DEFAULT_MULTI_CSV_SEPARATOR,

0 commit comments

Comments
 (0)