-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usability of finding a header row and skipping rows #147
Comments
Sorry I probably do not understand your error. Are you using Range::range method? |
Yeah. This is about usability/ergonomics. Since my header row wasn't the first row, I had to first find the correct row and then skip Having to find the header row manually was a bit annoying, but I'm not sure how the library would offer this functionality in a natural way. Then I had to skip I might not have made the second mistake if fn skip_rows(range: Range<DataType>, n: u32) -> Result<Range<DataType>, Error> {
if range.is_empty() {
return Err(Error::new("Range was empty"));
}
let start = range.start().unwrap();
let end = range.end().unwrap();
Ok(range.range((start.0 + n, start.1), end))
} |
It is not the case. Do you have an example? I think what you're confused about is probably relative ( What we could do is probably improve doc first. Then we could have a new |
Sorry for the long silence
I was mistaken, it seems like Anyway, I wrote helper functions as in https://gist.github.com/TimoFreiberg/3cfc0163d5b1e5b3e4fab11f948b5299 and I thought maybe something like the |
I have to read excel sheets with headers where the header row is not the first row.
I currently try to solve this by first using
range.rows().enumerate().find(...)
to get a row that contains the header names I expect and then using the index of that row to get a subrange of my original range.I introduced a bug by using the index I got from that process as the new start and therefore started at e.g. row 3 instead of 26. I fixed that by adding the found header index to the current range start.
I guess this is kind of hard to use :/
The text was updated successfully, but these errors were encountered: