equal
deleted
inserted
replaced
22 // It should read the corresponding CSV-file and reads the January |
22 // It should read the corresponding CSV-file and reads the January |
23 // data from the given year. The data should be collected in a list of |
23 // data from the given year. The data should be collected in a list of |
24 // strings for each line in the CSV-file. |
24 // strings for each line in the CSV-file. |
25 |
25 |
26 def get_january_data(symbol: String, year: Int) : List[String] = |
26 def get_january_data(symbol: String, year: Int) : List[String] = |
27 Source.fromFile(symbol ++ ".csv")("ISO-8859-1").getLines.toList.filter(_.startsWith(year.toString)) |
27 Source.fromFile(symbol ++ ".csv")("ISO-8859-1").getLines().toList.filter(_.startsWith(year.toString)) |
28 |
28 |
29 |
29 |
30 //test cases |
30 //test cases |
31 //blchip_portfolio.map(get_january_data(_, 2018)) |
31 //blchip_portfolio.map(get_january_data(_, 2018)) |
32 //rstate_portfolio.map(get_january_data(_, 2018)) |
32 //rstate_portfolio.map(get_january_data(_, 2018)) |