Skip to content

Instantly share code, notes, and snippets.

@luchoching
Created May 27, 2016 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luchoching/7c333865ad0fb6b09baf8eac5d27ca79 to your computer and use it in GitHub Desktop.
Save luchoching/7c333865ad0fb6b09baf8eac5d27ca79 to your computer and use it in GitHub Desktop.
csv to string : aa,bb,cc,dd --> 'aa','bb','cc'
import java.io._
val pw = new PrintWriter(new File("hello.txt" ))
val lines = "'"+Source.fromFile("power-users-list.csv").getLines.toList.mkString("','")+"'"
pw.write(lines)
pw.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment