Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The same excel, different results #1

Open
3xxx opened this issue Mar 8, 2016 · 0 comments
Open

The same excel, different results #1

3xxx opened this issue Mar 8, 2016 · 0 comments

Comments

@3xxx
Copy link
Owner

3xxx commented Mar 8, 2016

They like the same excel,but the different results.
my code:

package main

import (
    "fmt"
    "strconv"
    "github.com/tealeg/xlsx"
)
package main

import (
    "fmt"
    "strconv"
    "github.com/tealeg/xlsx"
)

type Catalog struct {
    Id          int64
    Name        string
    ParentId    int64
    Tnumber     string
    Drawn       string
    Designd     string
    Checked     string
    Emamined    string
    Verified    string
    Approved    string
    Data        string
    DesignStage string
    Section     string
    Projec      string
    Author      string
    Exist       bool
    TopicId     int64
}

func main() {
    test5()
}
func test5() {
    //  path := "D:/panic.xlsx"
    path := "D:/ok.xlsx"
    xlFile, _ := xlsx.OpenFile(path) //excelFileName

    var catalog Catalog
    for _, sheet := range xlFile.Sheets {
        for _, row := range sheet.Rows {
            j := 1
            catalog.Tnumber = row.Cells[j].String()
            catalog.Name = row.Cells[j+1].String()
            catalog.Drawn = row.Cells[j+2].String()
            catalog.Designd = row.Cells[j+3].String()
            catalog.Checked = row.Cells[j+4].String()
            catalog.Emamined = row.Cells[j+5].String()
            catalog.Verified = row.Cells[j+6].String()
            catalog.Approved = row.Cells[j+7].String()
            catalog.Data = row.Cells[j+8].String()
            catalog.DesignStage = row.Cells[j+9].String()
            catalog.Section = row.Cells[j+10].String()
            catalog.Projec = row.Cells[j+11].String()
            fmt.Printf("%s\n", catalog)
        }
    }
}

the panic file:panic.xlsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant