是否有任何属性来获取行的大小?
@sheet = Spreadsheet.open(file.path).worksheet 0 @sheet.rows_count # why they didn't it?
他们做到了,事实上=> @sheet.count
@sheet.count
如果您使用RubyXL,请使用以下内容来获取行数。
rowCount = worksheet.sheet_data.rows.size colCount = worksheet.cols.size