Created
June 26, 2013 09:41
-
-
Save sebastianwagner/5866164 to your computer and use it in GitHub Desktop.
Concatenate CSV files by taking heading first line of first file and appending all non-first-lines of remaining files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OUTFILE='outfile.csv' | |
#get header from first line of first file | |
head -n 1 result*_01_*.csv > "$OUTFILE" | |
#collect bodies for concatenation and append | |
tail --silent --lines=+2 result*_*_*.csv >> "$OUTFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment