File format where column names are repeated on each row
Using Miller (https://github.com/johnkerl/miller)

mlr --ocsv unsparsify input.txt


you will have this CSV

col1,col2,col3
datac1r1,datac2r1,datac3r1
datac1r2,datac2r2,datac3r2
datac1r3,datac2r3,datac3r3
datac1r4,datac2r4,datac3r4