-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels