Skip to content

Instantly share code, notes, and snippets.

@robsonalves
Created October 30, 2018 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robsonalves/0b6ed18006be576139a4fe647044875b to your computer and use it in GitHub Desktop.
Save robsonalves/0b6ed18006be576139a4fe647044875b to your computer and use it in GitHub Desktop.
Create a partiton file
tail -n +2 YOURFILE.csv/txt | split -l 1000 -d --additional-suffix=.csv - split_
for file in split_*
do
head -n 1 YOURFILE.csv/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