You do not convert the third and fourth tokens to Point , and you do not convert strings to List . In addition, you do not treat each element as Tuple3 , but as List .
The following should be more in line with what you are looking for.
case class Point(x: Double, y: Double) // Simple point class Source.fromFile(filename).getLines.map(line => { val tokens = line.split("""\s+""") // Use a regex to avoid empty tokens (tokens(0), tokens(1), Point(tokens(2).toDouble, tokens(3).toDouble)) }).toList // Convert from an Iterator to List
cheeken
source share