xls icon indicating copy to clipboard operation
xls copied to clipboard

Reading Numbers

Open ghost opened this issue 6 years ago • 2 comments

Hello,

I have a column with a formula to get numbers and i cannot retrieve those numbers:

package main

import (
	"fmt"

	"github.com/extrame/xls"
)

func main() {
	if xlFile, err := xls.Open("file.xls", "utf-8"); err == nil {
		if sheet := xlFile.GetSheet(0); sheet != nil {

			for i := 2; i <= (int(sheet.MaxRow)); i++ {
				row := sheet.Row(i)
				if row != nil {
					col := row.Col(3)
					fmt.Print("\n", col)
				}
			}
		}
	}

}

Everything else (text) i can retrieve

ghost avatar Oct 03 '18 17:10 ghost

The column that i want to retrieve if has numbers i get "General", if the column has formulas i get nothing in the screen.

ghost avatar Oct 04 '18 08:10 ghost

Problem with reading “general” instead of cell data is solved in my fork https://github.com/sergeilem/xls .

sergeilem avatar Mar 06 '19 20:03 sergeilem