Created
October 29, 2020 14:23
-
-
Save rupeshtr78/f237aed47e7ca71c1e868320f143823c 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 java.io.{FileWriter, PrintWriter} | |
import scala.io.Source | |
val fileLines = Source.fromFile("/data/bullflag.txt").getLines() | |
for ((line, n) <- fileLines zipWithIndex) { | |
val lineNumber = n+1 | |
val fileName = s"line-$lineNumber.txt" | |
val filePath = s"/data/$fileName" | |
val fileWriter = new PrintWriter(new FileWriter(filePath)) | |
fileWriter.write(line) | |
fileWriter.close() | |
Thread.sleep(20000) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment