import io.Source
import scala.util._
object Foo {
def get_data(symbol: String) : List[String] =
Source.fromFile(symbol ++ ".csv")("ISO-8859-1").getLines.toList
def process(s: String) : String = {
val l = s.split(",").toList
l(0) + "," + l(5)
}
def clean(sym: String) = {
val da = get_data(sym)
val out =
for (l <- da;
if l.drop(4).startsWith("-01")) yield process(l)
println(process(da.head))
out.foreach { println }
}
def main(args: Array[String]) = clean(args(0))
}