learning scala read from file
Posted lianghong881018
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了learning scala read from file相关的知识,希望对你有一定的参考价值。
scala读文件:
example:
scala> import scala.io.Source
import scala.io.Source
scala> var inputFile = Source.fromFile("text.txt")
inputFile: scala.io.BufferedSource = non-empty iterator
scala> for ( line <- inputFile.getLines()) println(line)
hello panzidong
spark is good
scala> inputFile.close()
以上是关于learning scala read from file的主要内容,如果未能解决你的问题,请参考以下文章
canal启动报错ERROR c.a.o.canal.parse.inbound.mysql.dbsync.DirectLogFetcher - I/O error while reading fro
learning scala PartialFunction
learning scala control statement
learning scala for comprehensions