umya-spreadsheet
umya-spreadsheet copied to clipboard
how to iterate rows in Worksheet?
this might be something super obvious but somehow I still missing this part even after reading docs. So how do I iterate rows in Worksheet?
so far I only find this way to iterate rows:
(1..data.get_highest_row()).for_each(|i|{
let row = data.get_collection_by_row_to_hashmap(&i);
...
});
but maybe it would be better to implement Iterator or IntoIterator for Worksheet?
@SET001 Thank you for contacting us. Currently, the following can be implemented.
for row_dimension in data.get_row_dimensions() {
let row = data.get_collection_by_row_to_hashmap(row_dimension.get_row_num());
}
However, get_row_dimensions() has the following limitations The data is not sorted. Empty rows are not included.
I believe future versions will have iter_cells_by_row type API which has already been merged in, I think.