Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.PrintWriter
- import scala.io.Source
- //**Lab 9 CSC 110 Prof. Duncan
- //**Andy Mechalakos
- val term = args(0)
- val sampleInput = args(1)
- val sampleOutput = args(2)
- val out = new PrintWriter(sampleOutput)
- println("I am searching for "+ term)
- val inputStream = Source.fromFile(sampleInput)
- val lines = inputStream.getLines
- // println(lines.mkString("\n"))
- for (line <- lines if line.toLowerCase.contains(term))
- {
- out.println(line)
- println(line)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement