Skip to content

Instantly share code, notes, and snippets.

@danslapman
Created June 26, 2018 14:51
Show Gist options
  • Save danslapman/b7a8453cec542f62601178b070259b66 to your computer and use it in GitHub Desktop.
Save danslapman/b7a8453cec542f62601178b070259b66 to your computer and use it in GitHub Desktop.
Scala scripting cookbook
import java.nio.file.{Files, Paths, StandardOpenOption => SOO}
import scala.io.Source
import collection.JavaConverters._
val sep = System.lineSeparator
val file = Source.fromFile(..)
val data = file.getLines
...
.asJava
file.close()
Files.write(Paths.get(..), data, SOO.WRITE, SOO.CREATE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment