Skip to content

Instantly share code, notes, and snippets.

@motoso
Last active January 2, 2016 06:49
Show Gist options
  • Select an option

  • Save motoso/8265926 to your computer and use it in GitHub Desktop.

Select an option

Save motoso/8265926 to your computer and use it in GitHub Desktop.
【Python】[ブース] [サークル名]の項目が並んだテキストファイルからサークル名のみを抽出したテキストファイルを作成するプログラム.コミティアのサークル名簿( http://www.comitia.co.jp/100/100list.html )からサークル名を抜き出すために作成.このあと,むちゃくちゃ形態素解析した.
# coding: UTF-8
import sys
argv = sys.argv
argc = len(argv)
if (argc < 3):
print "Usage: # python %s [input] [output]" % argv[0]
quit()
try:
file = open(argv[2],"w")
except IOError:
print "Error: file can not open."
except:
print "Unexpected error."
for line in open(argv[1], "r"):
itemList = line.split(" ",1) # Only first space is considerable
(address, name) = tuple(itemList)
# print name
file.write(name)
file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment