Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

scala read lines from file

import scala.io.Source

val filename = "fileopen.scala"
for (line <- Source.fromFile(filename).getLines) {
    println(line)
}
Source by alvinalexander.com #
 
PREVIOUS NEXT
Tagged: #scala #read #lines #file
ADD COMMENT
Topic
Name
4+2 =