Created
July 3, 2017 04:40
-
-
Save jduckles/73a2fa52d72ab9a08867c2d6cb7c8b46 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# unzip files | |
for filename in $(ls *.zip); do | |
unzip $filename | |
done | |
# find paths of csv files and store as a variable | |
files=$(find . -name "*.csv") | |
# take header row from first file and write it to otput file | |
head -1./1/1.csv > output.csv # write header to file | |
for item in $files; do | |
tail -n +2 $item >> output.csv | |
done | |
echo "All lines have been combined in output.csv" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment