This commit is contained in:
Liu Ming
2017-02-21 16:59:50 +08:00
parent f02a04cbdd
commit 79987c0cd7
3 changed files with 9 additions and 33 deletions

View File

@@ -17,31 +17,5 @@ It has just the reading function without the format.
* Use **Open** function for open file
* Use **OpenReader** function for open xls from a reader
These methods will open a workbook object for reading, like
func (w *WorkBook) ReadAllCells() (res [][]string) {
for _, sheet := range w.Sheets {
w.PrepareSheet(sheet)
if sheet.MaxRow != 0 {
temp := make([][]string, sheet.MaxRow+1)
for k, row := range sheet.Rows {
data := make([]string, 0)
if len(row.Cols) > 0 {
for _, col := range row.Cols {
if uint16(len(data)) <= col.LastCol() {
data = append(data, make([]string, col.LastCol()-uint16(len(data))+1)...)
}
str := col.String(w)
for i := uint16(0); i < col.LastCol()-col.FirstCol()+1; i++ {
data[col.FirstCol()+i] = str[i]
}
}
temp[k] = data
}
}
res = append(res, temp...)
}
}
return
}
* Follow the example in GODOC