0

I have a requirement to parse a log file in a Linux dir and use information in that log file as some status, create a HTML table and send a mail so that the information looks in a tabular format. Generally, I parse a file in Scala in the following way:

import scala.io.Source

val filename = "fileopen.scala"
for (line <- Source.fromFile(filename).getLines) {
    println(line)
}

But I am trying to put the parsed information into a HTML Table which I don't have a clue about. I know this can be done in Java as folks in my project have their UI code (HTML) mixed with Java code. Could anyone let me know if it is possible to in Scala. Is there any documentation or links to implement it in Scala ?

3
  • Please refer the following post stackoverflow.com/questions/15630690/… Commented Jun 11, 2018 at 11:17
  • 1
    Have you looked into the Scala Play Framework? Commented Jun 11, 2018 at 13:41
  • 1
    Take a look at template engines like Twirl (used by Play, more scala-specific), or simpler frameworks like Mustache. For generating tables, simply writing out the HTML directly as string might be enough. Commented Jun 11, 2018 at 14:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.