Created
June 9, 2014 15:39
-
-
Save ivansabik/5455dd1446f627b38cf4 to your computer and use it in GitHub Desktop.
Split CSV to multiple files with Shell script
This file contains 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
#!/bin/bash | |
tail -n +2 CONSO.txt | split -l 20000000 - split_ | |
for file in split_* | |
do | |
head -n 1 CONSO.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