21
0
xls/xls_test.go

29 lines
745 B
Go
Raw Normal View History

2015-09-30 05:17:25 +02:00
package xls
import (
"fmt"
"testing"
)
func TestOpen(t *testing.T) {
2017-02-21 09:59:50 +01:00
if xlFile, err := Open("t1.xls", "utf-8"); err == nil {
2016-05-28 04:39:46 +02:00
if sheet1 := xlFile.GetSheet(0); sheet1 != nil {
fmt.Println("Total Lines ", sheet1.MaxRow, sheet1.Name)
2017-02-21 09:59:50 +01:00
for i := 265; i <= 267; i++ {
2017-02-21 09:27:01 +01:00
fmt.Printf("row %v point %v \n", i, sheet1.Row(i))
if sheet1.Row(i) == nil {
2016-05-28 04:39:46 +02:00
continue
}
2017-02-21 09:27:01 +01:00
row := sheet1.Row(i)
for index := row.FirstCol(); index < row.LastCol(); index++ {
fmt.Println(index, "==>", row.Col(index), " ")
2017-02-21 09:59:50 +01:00
fmt.Printf("%T\n", row.cols[uint16(index)])
2016-05-28 04:39:46 +02:00
}
// col1 := .Cols[0]
2017-02-21 09:27:01 +01:00
// col2 := sheet1.Row(uint16(i)].Cols[1]
2016-05-28 04:39:46 +02:00
// fmt.Printf("\ncol1 %v \nCol2 %v \n", col1.String(xlFile), col2.String(xlFile))
}
2015-09-30 05:17:25 +02:00
}
}
}