【发布时间】:2014-10-10 13:04:47
【问题描述】:
我目前从事机器学习数学(准确地说是 NLP)。在执行任务时,我遇到了一个问题。我想打印出包含以下任何正则表达式的行:
1)fbchat
2)fb_timeline
3)Facebook 墙贴
成一个单独的文本文件,一个用于上面提到的每个字符串。
然后在每个生成的文本文件中,我想根据 messaged.dmpthread ID 字段对每一行进行排序/em>。 我是一个理论人,编程经验很少。
数据库转储的下载链接如下
更新:
这是我尝试编写的脚本:
import re
from sys import argv
scrip, file_name = argv
dfile = open(file_name, 'r')
for line in dfile:
if re.match("fbchat", line):
print line
但是脚本什么也没做。
【问题讨论】:
-
我知道你是
a theoretical person with very less programming experience但请参考help 你不能问questions you haven't tried to find an answer for你需要展示你的作品。 -
@KobiK 我已经更新了我的问题...请通过