Read some specific lines from a big file in python

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

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

How to write comments in batch files for ffmpeg?

Updated October 09, 2019 22:26 PM

How to switch the order of text in a line?

Updated November 19, 2017 22:26 PM

How to read specific lines from a text file in PHP

Updated February 10, 2018 20:26 PM