0
Good morning!
I am with a project that I am improving and would like to make a For i to run all variables within the project, but when running it applies the project only to the last variable.
Code:
for i in ['1', '2', '3']:
arquivo5 = open(r'\Texto para SAS\Vers' + str(i) + '.txt', 'w')
with open(r'\DataMining Python\Respostas.txt') as stream:
with open(r'\Texto para SAS\teste.txt', 'r') as arq:
palavras = arq.readlines()
for line in stream:
for word in palavras:
if word.lower() in line.lower():
a = (line.strip(), '¬', word + '\n\r')
arquivo5.writelines(a)
print(i)
arquivo5.close()
Reply.txt:
Muita cobranca para meu time
Cobrar nao e viver
Nao me cobre por isso
test.txt
cobra
cobranca
Perfect! Thank you! Sorry I doubt
– Gigliotti
@Gigle imagines, it’s wrong to learn!
– Pedro von Hertwig Batista