Skip to content

Instantly share code, notes, and snippets.

@jduckles
Created July 3, 2017 04:40
Show Gist options
  • Save jduckles/73a2fa52d72ab9a08867c2d6cb7c8b46 to your computer and use it in GitHub Desktop.
Save jduckles/73a2fa52d72ab9a08867c2d6cb7c8b46 to your computer and use it in GitHub Desktop.
# 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