Created
November 21, 2016 21:48
-
-
Save loochao/230bab67966466699c5c25192b6699e3 to your computer and use it in GitHub Desktop.
Split big library index files (txt format) into smaller ones (10000 lines per file)
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
| archive="../_lib.idx_achive/" | |
| if [ ! -d $archive ]; then | |
| mkdir $archive | |
| fi | |
| for i in `ls`; do | |
| if [ $i != $0 -a ! -d $i ]; then | |
| fullname=$i; | |
| name=${i%.*}; | |
| if [ ! -d $name ]; then | |
| mkdir $name; | |
| fi | |
| gsplit -l 10000 -d --additional-suffix=.txt $fullname $name/$name"_" | |
| mv $fullname $archive | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment