scala read text file 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)
}