1

Extracting first rows of .csv files into a single new .csv file

view story
linux-howto

http://unix.stackexchange.com – 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.csv But 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! (HowTos)