Created
June 7, 2017 11:57
-
-
Save equivalentideas/070e7be07985cabbad5334fb6b7f5bf2 to your computer and use it in GitHub Desktop.
Bash script for dividing emails.txt into separate .csv files for each 2000 email addresses
This file contains hidden or 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
line_count=$(cat emails.txt | wc -l) | |
file_count=0 | |
while [ $file_count -lt $line_count ] | |
do | |
echo "creating file emails_$file_count.csv" | |
tail -n+$file_count emails.txt | head -n2000 >> emails_$file_count.csv | |
file_count=$[$file_count+2000] | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment