There is a strange .csv file, something like:
header1,header2,header3
val11,val12,val13
val21,val22,val23
val31,val32,val33
pretty well, but after these lines there is always an empty line followed by a lot of useless lines. All material is a line:
header1,header2,header3
val11,val12,val13
val21,val22,val23
val31,val32,val33
dhjsakfjkldsa
fasdfggfhjhgsdfgds
gsdgffsdgfdgsdfgs
gsdfdgsg
The number of lines at the bottom is completely random, the only caveat is the empty line in front of them.
Pandas has a skipfooter parameter to ignore the known number of lines in the footer.
Any idea on how to ignore these lines without opening the (open () ...) file and deleting them?
source
share