Skip to content

Instantly share code, notes, and snippets.

@abada
Created February 12, 2018 09:00
Show Gist options
  • Save abada/6ee693cd8ff66d28ae6a0201d9117596 to your computer and use it in GitHub Desktop.
Save abada/6ee693cd8ff66d28ae6a0201d9117596 to your computer and use it in GitHub Desktop.
split csv file
tail -n +2 file.txt | split -l 1000 - split_
for file in split_*
do
head -n 1 file.txt > tmp_file
cat $file >> tmp_file
mv -f tmp_file $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment