Readlines and find a match
I am making 2 scripts to do some work for me.
For one script I already made a topic.
The reason why I make a 2nd topic for the other script is that they are a little bit similair. But through the huge amount of data I think 2 scripts will be better becose of the amount of time it would take to run them if combined.
For this script I am reading in a file. And I make the script read the file line by line. Now are in the file "Test.txt" Words I am looking for. "Query=". There are lines that begin with this word.
And I would like to know what function to use when to look for a specifick word.
Eventualy I want the script to find the word "Query=" and remember the letter/number code behind it. And then look 5 lines lower to find another word match. And if there is a match to write the number to file1, and if no match to file2. And to do that for 5.000+ "Query=". (But I only want 2 output files. All who matched, and all who non matched)