I connect to the API to get some data. The result is a report that includes a multi-line header combined with a traditional single-line header.
Example:
1. Document Name: Test 2. Document Date: 8/7/2015 3. Document ID: 3804804 4. Document Author: Joe Blow 5. 6. Date, ID, Name, Age, Sex, Result 7. 8/7/2015, 2808380, Sara Jenkings, 33, F, 208.20
In this example, I want to skip lines 1 - 5 and write a line in line 6 as a title line, and all other lines after that - as regular lines.
Now I know how to skip one line using next(reader, None) , but how to skip more than one line if I know that the number of skipped lines will be 5 lines, as in the example?
I would usually use a database to skip rows, but I want to see if I can get Python to save data correctly without doing any extra work with the database.
source share