aboutsummaryrefslogtreecommitdiffstats
path: root/reader
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2019-11-03 22:13:06 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2019-11-03 22:13:06 +0000
commit4617ab0e8213c4a347f65b39f01ce552b0445e3d (patch)
tree5ec8bc2c6935dc0609d57f0ba0af071200970d1e /reader
parentcf96e06b1f5e9d0037874f49c99e6f2b38369f5b (diff)
fixed row issue
Diffstat (limited to 'reader')
-rw-r--r--reader/reader.go10
-rw-r--r--reader/testdata/test_template.xlsxbin7964 -> 8088 bytes
2 files changed, 3 insertions, 7 deletions
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)
}
}
}
diff --git a/reader/testdata/test_template.xlsx b/reader/testdata/test_template.xlsx
index d1561e5..5d7f0ce 100644
--- a/reader/testdata/test_template.xlsx
+++ b/reader/testdata/test_template.xlsx
Binary files differ