I have over 1000 .csv files in a folder on Debian Squeeze. I am trying to create a new .csv file containing ONLY the first rows of each of these 1000 .csv files.I tried:read -r firstline < sourcefile_1.csv > headers.csvBut that only created a blank file. (And even if it did work, I would have copied only the first row of just one file.)How do I write a command that copies the first rows of all 1000 files in the folder and add it to the new .csv file?Thanks in advance!
Extracting first rows of .csv files into a single new .csv file
debian
head -q -n 1 *.csv > output.csv-q supresses the headers that normally get printed, -n 1 prints only the first line