How Can I Skip First Several Lines Of The Excel Sheet?
Using openpyxl I tried to read from the fifth line for some files. The files' first four lines are the header. Then the main content has a different format from the header. And I t
Solution 1:
You can pass a range into ws.iter_rows('A4:Z256') but you're probably better off using ws.get_squared_range(1, 5,)
Solution 2:
You can skip the first N rows by passing the optional min_row argument. Note that this uses a 1-base index, so min_row=2 starts on the second row and min_row=5 skips the first four rows. You would be using something like this:
for index, row in enumerate(ws.iter_rows(min_row=5)):
Post a Comment for "How Can I Skip First Several Lines Of The Excel Sheet?"