12.07.2015 Views

METODOLOGIA DE MINERAÇÃO DE DADOS PARA ANÁLISE DO ...

METODOLOGIA DE MINERAÇÃO DE DADOS PARA ANÁLISE DO ...

METODOLOGIA DE MINERAÇÃO DE DADOS PARA ANÁLISE DO ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Exclui_uri_stem_irrelevantes.pyimport stringimport os.pathimport timeprint time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())print 'Separa logs contendo apenas uri-stem que devem ser considerados...'print '------------------------------------------------------------------'#le arquivo de configuracao (diretorio de trabalho)arqconf = 'Configuracao.txt'entradaconf = open(arqconf)if os.path.isfile(arqconf):for line in entradaconf:diretorio = line[0:len(line)-1]breakelse:print 'Arquivo de configuracao nao encontrado...'entradaconf.close()total = 0total1 = 0excluido = 0gravado = 0nid = 0considerar = []arqin = diretorio + '\Trabalho\\uri_stem_considerados.log'if os.path.isfile(arqin):entrada = open(arqin)for line in entrada:rec = string.splitfields(line, ' ')total1 = total1 + 1considerar.append(rec[0])entrada.close()else:print 'Arquivo ' + arqin + ' nao encontrado...'print ''print str(total1) + ' uri-stem considerados carregados em memoria'arqin = diretorio + '\Trabalho\\sessao.log'arqout1 = diretorio + '\Trabalho\\sessao_considerada.log'saida1 = open(arqout1, 'w')arqout2 = diretorio + '\Trabalho\\sessao_eliminada.log'saida2 = open(arqout2, 'w')print ' 'print 'arqin: ', arqinprint ' 'print 'arqout1: ', arqout1print 'arqout2: ', arqout2print ' 'if os.path.isfile(arqin):188

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!