more date reading enhancements

This commit is contained in:
sergeilem
2019-03-06 23:13:03 +03:00
parent 47f24af084
commit c849b3b45d
7 changed files with 9 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ import (
)
//Compares xls and xlsx files
func compareXlsXlsx(xlsfilepathname string, xlsxfilepathname string) string {
func CompareXlsXlsx(xlsfilepathname string, xlsxfilepathname string) string {
xlsFile, err := Open(xlsfilepathname, "utf-8")
if err != nil {
return fmt.Sprintf("Cant open xls file: %s", err)
@@ -27,8 +27,8 @@ func compareXlsXlsx(xlsfilepathname string, xlsxfilepathname string) string {
for row, xlsxRow := range xlsxSheet.Rows {
xlsRow := xlsSheet.Row(row)
for cell, xlsxCell := range xlsxRow.Cells {
xlsText := xlsRow.Col(cell)
xlsxText := xlsxCell.String()
xlsText := xlsRow.Col(cell)
if xlsText != xlsxText {
//try to convert to numbers
xlsFloat, xlsErr := strconv.ParseFloat(xlsText, 64)