All,

Thanks for all the suggestions.
I cleaned out everything with: go clean -r -i …
installed go 1.9 and created a file new test file of:
package main

import (
    "fmt"
    "os"

    "github.com/plandem/xlsx"
)

func checkErr(err error) {
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}

func main() {

    xl, err := xlsx.Open("test.xlsx")
    checkErr(err)
    defer xl.Close()

    sheet := xl.Sheet(0)

    for iRow, iMax := 0, sheet.TotalRows(); iRow < iMax; iRow++ {
        row := sheet.Row(iRow)

        for iCol, cell := range row.Cells() {
            fmt.Println(" %q %q ", iCol, cell.Value)
        }

    }
}

And the results were not good I could not get cell values, further when 
empty cell are encounter with  plandem/xlsx I get a panic when it executes.

Good news with cleaning everything our and install a fresh copy of 1.9 I 
can generate and read with excelize.

I am disappointed in the compiler upgrade process and lack of error 
messages during previous attempts.

Lessons learned , delete everything with go clean -r -i …, and rebuild with 
go install ….

Not a perfect solution, but GOfigure :)

As additional test I opened and saved the xlsx with libreoffice 5.4.0.3 (on 
osx 10.12.6) and the simple test failed again.
Then I opened and save the file with excel 2016 (widow 10) and excelize 
reads the file with no errors and correct output(on osx and ubuntu 17.10).
Bottom line sticking with excelize, due to better documentation and 
functional.

Thanks again!

On Friday, August 25, 2017 at 3:10:40 PM UTC-7, G Shields wrote:
>
> Under 1.8.3 the program run:
> package main
>
> import (
>     "fmt"
>     "os"
>     "strconv"
>
>     "github.com/Luxurioust/excelize"
> )
>
> func checkErr(err error) {
>     if err != nil {
>         fmt.Println(err)
>         os.Exit(1)
>     }
>
> }
> func main() {
>
>     xlsx, err := excelize.OpenFile("test.xlsx")
>     checkErr(err)
>     mysheet := xlsx.GetSheetName(1)
>     index := xlsx.GetSheetIndex(mysheet)
>     rows := xlsx.GetRows("Sheet" + strconv.Itoa(index))
>     for _, row := range rows {
>         for _, colCell := range row {
>             fmt.Print(colCell, "\t")
>         }
>         fmt.Println()
>     }
> }
>
> With results of:
> na    Apple    Orange    Pear    
> Small    2    3    3    
> Normal    5    2    4    
> Large    6    7    8
> Success: process exited with code 0.
>
> Under 1.9 I get no data and no errors:
> Success: process exited with code 0.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to