Read some specific lines from a big file in python

by fahimnawaz7   Last Updated October 20, 2019 05:26 AM

I want to read some specific lines from a large text file where line numbers are in a list, for example: list_Of_line =[3991, 3992, ...]. I want to check whether there is the string "this city" in line number 3991, 3992,... or not. I want to directly access those lines. How can I do it in python?



Related Questions


Updated October 09, 2019 22:26 PM

Updated November 19, 2017 22:26 PM

Updated May 08, 2018 19:26 PM

Updated December 21, 2018 12:26 PM

Updated February 10, 2018 20:26 PM