Skip to content

Commit

Permalink
import scala.io.Source
Browse files Browse the repository at this point in the history
  • Loading branch information
rightgo09 committed Dec 30, 2012
1 parent 081b7cd commit f03cfd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 03-04/TextCounter030.scala
@@ -0,0 +1,8 @@
import scala.io.Source

val filename = args(0)
val src = Source.fromFile(filename) // オブジェクトを取得
val lines = src.getLines
for (line <- lines) {
println(line)
}
2 changes: 2 additions & 0 deletions 03-04/data.txt
@@ -0,0 +1,2 @@
Hello Wolrd
Scala Programming Sample

0 comments on commit f03cfd0

Please sign in to comment.