Skip to content

Instantly share code, notes, and snippets.

@yono
Created October 24, 2010 05:49
Show Gist options
  • Save yono/643172 to your computer and use it in GitHub Desktop.
Save yono/643172 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
filenum = sys.argv[1]
afile = open('femo-%s.txt' % (filenum)).read().splitlines()
memo = []
directory = 'memo%s' % (filenum)
num = 1
for line in afile:
if line.startswith('created_on'):
writefile = open("%s/%d.txt" % (directory, num), 'w')
writefile.write("\n".join(memo))
writefile.close()
print num
num += 1
memo = []
else:
memo.append(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment