Skip to content

Instantly share code, notes, and snippets.

@trico
Last active August 29, 2015 14:14
Show Gist options
  • Save trico/e2d942a554aec5f3bd6c to your computer and use it in GitHub Desktop.
Save trico/e2d942a554aec5f3bd6c to your computer and use it in GitHub Desktop.
#!/bin/bash
tail -n +2 $1 | split -l 10000 - split_
for file in split_*
do
head -n 1 $1 > tmp_file
cat $file >> tmp_file
mv -f tmp_file output/$file.csv
rm $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment