in reply to Printing th entire line with a keyword
But here we are iterating through each line which is time consuming.Is there an easy method?
No. The only way to read something is to read it, there is no shortcut.