I want to read CSV file using python by skiprows dynamically after condition.
Condition - whenever I found 6 cols in CSV read from there or either when i find col names sequence as those 6 cols.
File.csv
Col1,col2,col3
1,2,3
13,u,u
,,,
,,,
Col1,col2,col3,col4
1,2,3,4
13,u,u,y
,,,
,,,
Col1,col2,col3,col4,col5,col6
1,2,3,4,5,6
qw,ers,hh,yj,df,ji
Now I'm reading this file using pandas.read_csv()
I know that at 10th row i have required cols.
pandas.read_csv("file.csv", skiprows=10, header=None)
Want to skip this dynamically by skipping rows when we 6 cols or either in this sequence col1,col2,col3,col4,col5,col6.
start = df.loc[df.FILE-START == 'col1,col2,col3,col4,col5,col6'].index[0]
df = pd.read_csv(filename, skiprows = start + 1)
Tried this but it's not working.