Last active
June 25, 2017 13:26
-
-
Save moshemal/696692a671fdf85595df40fa0307cdfa to your computer and use it in GitHub Desktop.
concat csv files into one file
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/bash | |
dataPath=$1 | |
outFilePath=$2 | |
files=(`ls ${dataPath}`) | |
#write the column names | |
head -n 1 ${dataPath}/${files[0]} > ${outFilePath} | |
#concat all data | |
for file in ${files[*]} | |
do | |
tail -n +2 ${dataPath}/${file} >> ${outFilePath} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment