Update README.

formula
Ri Xu 8 years ago
parent 78eb982052
commit 6adcb9d88f

@ -41,7 +41,7 @@ func main() {
xlsx.NewSheet(3, "Sheet3") xlsx.NewSheet(3, "Sheet3")
xlsx.SetCellInt("Sheet2", "A23", 10) xlsx.SetCellInt("Sheet2", "A23", 10)
xlsx.SetCellStr("Sheet3", "B20", "Hello") xlsx.SetCellStr("Sheet3", "B20", "Hello")
err = xlsx.WriteTo("/home/Workbook.xlsx") err := xlsx.WriteTo("/tmp/Workbook.xlsx")
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
@ -64,16 +64,16 @@ import (
) )
func main() { func main() {
xlsx, err := excelize.OpenFile("/home/Workbook.xlsx") xlsx, err := excelize.OpenFile("/tmp/Workbook.xlsx")
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
xlsx.SetCellInt("Sheet2", "B2", 100) xlsx.SetCellValue("Sheet2", "B2", 100)
xlsx.SetCellStr("Sheet2", "C11", "Hello") xlsx.SetCellValue("Sheet2", "C7", "Hello")
xlsx.NewSheet(3, "TestSheet") xlsx.NewSheet(4, "TestSheet")
xlsx.SetCellInt("Sheet3", "A23", 10) xlsx.SetCellInt("Sheet4", "A3", 10)
xlsx.SetCellStr("Sheet3", "b230", "World") xlsx.SetCellStr("Sheet4", "b6", "World")
xlsx.SetActiveSheet(2) xlsx.SetActiveSheet(2)
err = xlsx.Save() err = xlsx.Save()
if err != nil { if err != nil {
@ -96,12 +96,12 @@ import (
) )
func main() { func main() {
xlsx, err := excelize.OpenFile("/home/Workbook.xlsx") xlsx, err := excelize.OpenFile("/tmp/Workbook.xlsx")
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
cell := xlsx.GetCellValue("Sheet2", "D11") cell := xlsx.GetCellValue("Sheet2", "C7")
fmt.Println(cell) fmt.Println(cell)
} }
``` ```

Loading…
Cancel
Save