Question: Is a way to pen a text file, read a few lines, close it, re-open it and start reading from the line where you left off before? Or do you always have to start from the top?

Answer: 
You sure can! This is not going to be the fastest method, but it is going to work. And, by the way, the people who responded to your question by telling you that you should just start reprocessing from the beginning of the file TOTALLY missed the point of your question. There are an ample amount of reasons to want to return to where you left off. 

Here is some code I wrote that allows you to store a counter value, and then iterate through the file until you re-reach the counter value... at which point the loop takes affect and process what is in the loop for the remaining lines.

Cheers!

```
//define input text file
def file = new File('C:\\inputtextfile.txt')
//define file for the last referenced counter
def CountFile = new File ('C:\\prime\\lastcount.txt')

//if the counter was null set it to zero
if (CountFile.eachLine({it}) == null){
CountFile.write('0')
}

//read the counter into a value
StartLine = CountFile.eachLine( {it} ) as long
//set the first line of the file
lineCount=0

file.eachLine { line  ->
if (lineCount >= StartLine){

//write the counter to a text file
////////////////////////////////////////////////////////////////
CountFile.write(lineCount.toString())
    lineCount++
///////////////////////////////////////////////////////////////
}

```
I'm pretty sure every time you open a file, it starts you from the beginning.