私はPythonが初めてです。.txt
現時点では、大量のデータを含むファイルを読み取り、(xxx)xxx-xxxx
.
これが私の現在の試みですが、まったく機能せず、迷っています:
#import argv
from sys import argv
script, filename = argv
txt_file = open(filename)
indata = txt_file.read()
#confirm to the user what file is being open
print "Opening %r" % filename
#create a loop to read through the file
for line, in line enumerate(indata):
if line == "(" + \w\w\w\ + ")" + \w\w\w "-" + \w\w\w
print line
txt_file.close()
これを機能させる方法について誰かが提案してくれますか?