scala.io.Source.fromPath(filename).getLines().foreach { line => // do something }