Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ExcelMerge/ExcelWorkbook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ public ExcelWorkbook()

public static ExcelWorkbook Create(string path, ExcelSheetReadConfig config)
{
if (Path.GetExtension(path) == ".csv")
var ext = Path.GetExtension(path).ToLower();
if (ext == ".csv")
return CreateFromCsv(path, config);

if (Path.GetExtension(path) == ".tsv")
if (ext == ".tsv")
return CreateFromTsv(path, config);

var srcWb = WorkbookFactory.Create(path);
Expand All @@ -34,11 +35,12 @@ public static ExcelWorkbook Create(string path, ExcelSheetReadConfig config)

public static IEnumerable<string> GetSheetNames(string path)
{
if (Path.GetExtension(path) == ".csv")
var ext = Path.GetExtension(path).ToLower();
if (ext == ".csv")
{
yield return "csv";
}
else if (Path.GetExtension(path) == ".tsv")
else if (ext == ".tsv")
{
yield return "tsv";
}
Expand Down