You can use the zipWithIndex from Iterable trait:
for ((line, i) <- Source.fromFile(args(0)).getLines().zipWithIndex) {
println(i, line)
}
You can use the zipWithIndex from Iterable trait:
for ((line, i) <- Source.fromFile(args(0)).getLines().zipWithIndex) {
println(i, line)
}