My text file looks like the following
"
file1
cols=
col1
col2
# this is a comment
col3
data
a,b,c
d,e,f
"
As you can see, the data only starts after the data
tag and the rows before that essentially tell me what the column names are. There could be some comments which means the number of rows before the data
tag is variable.
How can I parse that in R? Possibly with some tidy
tools?
Expected output is:
# A tibble: 2 x 3
col1 col2 col3
<chr> <chr> <chr>
1 a b c
2 d e f
Thanks!