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 ?

Metadata
  • 2,127
  • 9
  • 56
  • 127
  • Please refer the following post https://stackoverflow.com/questions/15630690/how-to-use-scala-and-html-code-inside-single-block – Chaitanya Jun 11 '18 at 11:17
  • 1
    Have you looked into the Scala Play Framework? – James Whiteley Jun 11 '18 at 13:41
  • 1
    Take a look at template engines like [Twirl](https://github.com/playframework/twirl) (used by Play, more scala-specific), or simpler frameworks like [Mustache](https://mustache.github.io/). For generating tables, simply writing out the HTML directly as string might be enough. – Andrey Tyukin Jun 11 '18 at 14:13

0 Answers0