Skip to content

Commit

Permalink
🐛 replace dot spliting with os.path.splitext. addressing #47
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed May 2, 2018
1 parent 6ad875c commit 5ec807f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyexcel_io/readers/csvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ def _load_from_file(self):
self.__line_terminator = self._keywords.get(
constants.KEYWORD_LINE_TERMINATOR, self.__line_terminator
)
names = self._file_name.split(".")
filepattern = "%s%s*%s*.%s" % (
names = os.path.splitext(self._file_name)
filepattern = "%s%s*%s*%s" % (
names[0],
constants.DEFAULT_MULTI_CSV_SEPARATOR,
constants.DEFAULT_MULTI_CSV_SEPARATOR,
Expand All @@ -345,7 +345,7 @@ def _load_from_file(self):
return [NamedContent(file_parts[-1], self._file_name)]

else:
matcher = "%s%s(.*)%s(.*).%s" % (
matcher = "%s%s(.*)%s(.*)%s" % (
names[0],
constants.DEFAULT_MULTI_CSV_SEPARATOR,
constants.DEFAULT_MULTI_CSV_SEPARATOR,
Expand Down

0 comments on commit 5ec807f

Please sign in to comment.