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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

i = (j * 3) + 3d2 = string.splitfields(rec[i], '-')h2 = string.splitfields(rec[i+1], ':')data2 = datetime.datetime(int(d2[0]),int(d2[1]),int(d2[2]),int(h2[0]),int(h2[1]),int(h2[2]))delta = data2 - data1if delta.days < 0 or delta.seconds < 0: print 'Erro: inconsistencia de datas!!!'if delta.days > 0 or delta.seconds > timeout:saida.write(linha + '\n')gravado = gravado + 1linha = head + ' ' + rec[i] + ' ' + rec[i+1] + ' ' + rec[i+2]else:if rec[i-1] rec[i+2]:if delta.seconds < deltamin:rec[i-1] = rec[i+2]else:linha = linha + ' ' + rec[i] + ' ' + rec[i+1] + ' ' + rec[i+2]else:if rec[i-1] not in repeticoes: #elimina repeticoes indesejadasif delta.seconds < deltamin:rec[i-1] = rec[i+2]else:linha = linha + ' ' + rec[i] + ' ' + rec[i+1] + ' ' + rec[i+2]data1 = data2saida.write(linha + '\n')gravado = gravado + 1else:saida.write(linha + '\n')gravado = gravado + 1entrada.close()else:print 'Arquivo ' + arqin + ' nao encontrado...'saida.close()print '--------------------------'print 'Lidos = ', totalprint 'Gravados = ', gravadoprint ''print 'Sucesso...'print time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())187

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

Saved successfully!

Ooh no, something went wrong!