Created
August 7, 2012 08:10
-
-
Save Rembane/3283014 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
from os.path import splitext | |
import sys | |
name, suff = splitext(sys.argv[1]) | |
fi = 0 | |
fh = open('%s%s.%s' (name, fi, suff), 'w') | |
for i,row in enumerate(open(sys.argv[1])): | |
fh.write(row) | |
if i > 0 and i % 500 == 0: | |
fh.close() | |
fi += 1 | |
fh = open('%s%s.%s' (name, fi, suff), 'w') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment