This commit is contained in:
Liu Ming
2017-02-21 16:27:01 +08:00
parent 1127e94c69
commit f02a04cbdd
6 changed files with 68 additions and 32 deletions

View File

@@ -24,13 +24,13 @@ func ExampleWorkBook_GetSheet() {
if xlFile, err := Open("Table.xls", "utf-8"); err == nil {
if sheet1 := xlFile.GetSheet(0); sheet1 != nil {
fmt.Print("Total Lines ", sheet1.MaxRow, sheet1.Name)
col1 := sheet1.Rows[0].Cols[0]
col2 := sheet1.Rows[0].Cols[0]
col1 := sheet1.Row(0).Col(0)
col2 := sheet1.Row(0).Col(0)
for i := 0; i <= (int(sheet1.MaxRow)); i++ {
row1 := sheet1.Rows[uint16(i)]
col1 = row1.Cols[0]
col2 = row1.Cols[1]
fmt.Print("\n", col1.String(xlFile), ",", col2.String(xlFile))
row1 := sheet1.Row(i)
col1 = row1.Col(0)
col2 = row1.Col(1)
fmt.Print("\n", col1, ",", col2)
}
}
}