Due to confidentiality reasons i can't post the data i'm working on, it works almost perfect, except it still gets the unwanted_line3=text but not other lines after that, so it just needs a slight adjustement.
Thank you kindly, sir!
Did you add in the question mark as Eily suggested? If you can't provide an equivalent sample dataset which shows the problem it's going to be very difficult to assist you further, unfortunately.