Scala: Read a file of stock symbols and convert it to CSV string output

Without any introduction or discussion, here’s a little Scala script I just wrote to read in a text file that contains stocks symbols, with one symbol per line, along with some blank lines; then convert those symbols to comma-separated output (CSV format) that I print to STDOUT:

import scala.io.Source

@main def SymbolsToCsv =
    val symbolRecs = Source.fromFile("symbols.txt").getLines.toList
    val symbolsString = symbolRecs.filter(_.trim != "")
                                  .mkString(",")
    println(symbolsString)

So in this case the input file looks like this:

GSLC
RSP

USMV
VIG

and the CSV output looks like this:

GSLC,RSP,USMV,VIG