extrame / xls

Pure Golang xls library
Apache License 2.0
331 stars 210 forks source link

Reading Numbers #49

Open ghost opened 6 years ago

ghost commented 6 years ago

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 commented 6 years ago

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

sergeilem commented 5 years ago

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