I've got over a thousand files in a directory. At the top of each file is a multi-line header. The number of lines in each header varies, but there is a marker signifying the end of the section I need. Below the header is thousands of lines of data that I don't need to look at. My question is this: Is there a way to jump out of an open file at a specified point, and then go on to the next file? Reading through the entire file when I only need the top few lines isn't very efficient when many of these files are around 40mb. Below is a sample snippet of what I'm using to open the files. Thanks in advance.