From 4617ab0e8213c4a347f65b39f01ce552b0445e3d Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 3 Nov 2019 22:13:06 +0000 Subject: fixed row issue --- reader/reader.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'reader/reader.go') diff --git a/reader/reader.go b/reader/reader.go index c49bd5a..6745d8b 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -68,7 +68,7 @@ func ReadDML(path string) ([]DatamapLine, error) { //ExtractedCell is Data pulled from a cell type ExtractedCell struct { cell *xlsx.Cell - colLidx string + colL string rowLidx int value string } @@ -107,10 +107,6 @@ func alphas(n int) []string { //ReadXLSX reads an XLSX file func ReadXLSX(excelFileName string) []ExtractedCell { var out []ExtractedCell - alphs := alphas(2) - for _, l := range alphs { - fmt.Printf("Letter: %s", string(l)) - } xlFile, err := xlsx.OpenFile(excelFileName) if err != nil { fmt.Printf("Cannot open %s", excelFileName) @@ -120,13 +116,13 @@ func ReadXLSX(excelFileName string) []ExtractedCell { for colLidx, cell := range row.Cells { ex := ExtractedCell{ cell: cell, - colLidx: string(alphs[colLidx]), + colL: alphaStream[colLidx], rowLidx: rowLidx + 1, value: cell.Value} out = append(out, ex) text := cell.String() log.Printf("Sheet: %s Row: %d Col: %q Value: %s\n", - sheet.Name, rowLidx, alphs[colLidx], text) + sheet.Name, ex.rowLidx, alphaStream[colLidx], text) } } } -- cgit v1.2.3