Quantcast
Channel: Read entire file in Scala? - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by Apurw for Read entire file in Scala?

$
0
0
import scala.io.sourceobject ReadLine{def main(args:Array[String]){if (args.length>0){for (line <- Source.fromLine(args(0)).getLine())println(line)}}

in arguments you can give file path and it will return all lines


Viewing all articles
Browse latest Browse all 20

Trending Articles