Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Add each_row_streaming options (offset, max_rows and pad_cells)
  • Loading branch information
fabien-michel committed Aug 21, 2015
1 parent f8237a9 commit 9f82b70
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,26 @@ xlsx.each_row_streaming do |row|
end
```

By default blank cells will be excluded from the array. To preserve, use the option pad_cells = true
```ruby
xlsx.each_row_streaming(pad_cells: true) do |row|
puts row.inspect # Array of Excelx::Cell objects
end
```

To stream only a part of the rows, you can use ```max_rows``` and ```offset```options.
```ruby
xlsx.each_row_streaming(offset: 1) do |row| # Will exclude first (enventually header) row
puts row.inspect # Array of Excelx::Cell objects
end
```

```ruby
xlsx.each_row_streaming(max_rows: 3) do |row| # Will yield 4 rows (it's automatically majored by 1) after the setted offset.
puts row.inspect # Array of Excelx::Cell objects
end
```

Iterate over each row

```ruby
Expand Down

0 comments on commit 9f82b70

Please sign in to comment.