Example #1
0
    // 获取表格的数字
	func Get_cell_int(sheet *xlsx.Sheet, row int, col int) int{
		cell := sheet.Cell(row - 1, col - 1)
		cell.String();
		i, err := strconv.Atoi(cell.String())
		if err != nil{
			// fmt.Println("字符串转换成整数失败 = ", cell.String(), err)
			i = 0
		}

		return i
	}
Example #2
0
    // 获取指定单元格的文本内容,如果是数字格式,则仍然转为文本
    func Get_cell_str(sheet *xlsx.Sheet, row int, col int) string{
		cell := sheet.Cell(row - 1, col - 1)
		return cell.String()
	}
Example #3
0
    // 单元格是否为空
    func Is_cell_empty(sheet *xlsx.Sheet, row int, col int) bool{
		cell := sheet.Cell(row - 1, col - 1)
		return cell.Value == "";
	}