Created
July 25, 2012 08:27
-
-
Save ntakk/3175084 to your computer and use it in GitHub Desktop.
ディレクトリ内にあるファイルを読み込んで出力するサンプル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import scalax.file.Path | |
| import scalax.file.PathSet | |
| object FilesRead { | |
| def main(args: Array[String]): Unit = { | |
| val fr = new FilesRead | |
| fr.readdir | |
| } | |
| } | |
| class FilesRead { | |
| def readdir:Unit = { | |
| val children: PathSet[Path] = Path("data").children() | |
| children.filter(_.isFile).foreach {child => | |
| child.lines().foreach { line => | |
| println(line) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment