Is it stored in file or in memory in some kind of collection?
There is method dropWhile
in all scala collections:
val s = Seq("..", "..", "one", "two", "three", "four", "five", "..", "..")
// Seq[String] = List(.., .., one, two, three, four, five, .., ..)
s.dropWhile{ _ != "four" }
// Seq[String] = List(four, five, .., ..)
It works for Iterator
, so you could use it like this:
val lines = io.Source.fromFile("bigFile.txt").getLines().dropWhile{ _ != "four" }