source fromfile getlines code example
Example: scala read lines from file
import scala.io.Source
val filename = "fileopen.scala"
for (line <- Source.fromFile(filename).getLines) {
println(line)
}
import scala.io.Source
val filename = "fileopen.scala"
for (line <- Source.fromFile(filename).getLines) {
println(line)
}