Skip to content

Instantly share code, notes, and snippets.

@Rembane
Created August 7, 2012 08:10
Show Gist options
  • Save Rembane/3283014 to your computer and use it in GitHub Desktop.
Save Rembane/3283014 to your computer and use it in GitHub Desktop.
#!/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