My requirement is to read a CSV file with around million lines by grepping particular string and displaying the output line.
Example CSV File:
Rob,school,oxford,tennis
James,school,cambridge,cricket
lucy,college,harvard,football
lily,hotel,novotel,golf
..
..
..
1 million lines.
Requirement:
When i invoke the AHK script , it prompts a user input through InputBox and takes input as James school and it should output as cambridge. Similarly input as lily hotel and it should output as novotel.
I am able to achieve the desired output through below script , but the problem is when i search for a string which is for example at 1 millionth line it takes around 5-10 mins to give me the output.
Script i wrote:
#SingleInstance, force
#Include C:\Users\mpechett\Desktop\ahk\tf.ahk
InputBox, Name, Search for Name
StringSplit, word_array, Name, %A_Space%, . ; Omits periods.
pattern = %word_array1%,%word_array2%
Outputline = % TF_Find("C:\Users\mpechett\example.csv", "","", pattern, 1, 1)
MsgBox,%Outputline%
Please help me in improving the performance of my script.