I have this command to split csv by number of rows, line=
part.
But this cmd does not keep headers from original file and I need to have the headers there. Can you please help me? I found that I need to keep headers separately and then somehow add the n of rows.
It loads output.csv
file and splits it every 33 rows in a result file which is called output<number>.csv
with numbers before the extension and starting from 1.
awk -v N=1 -v pre="output" -v suf=".csv" -v line=33 'NR%line==1{x=pre N suf ;N++} {print > x}' output.csv
How can I keep the headers and keep my functionality?