I've "looped" through Google but can't find a solution to my problem.
I have some txt files where I need to add line number 2 inside the text file whenever a condition is true.
When some other conditions are met, I need to replace a substring in that line.
I have found a way to get the line numbers' index, and a way to loop through the file.
But my loop only checks if the whole string is correct and not the index of the string.