Reputation: 6264
I have a file called product.csv
in my application root. I want to read from the file. But I am getting file not found exception. Here is the code I have written.
val lines = scala.io.Source.fromFile("/product.csv").mkString
println(lines)
What am I doing wrong?
I am using Windows OS.
Upvotes: 0
Views: 110
Reputation: 879
You need to use a relative filepath "product.csv"
rather than "/product.csv"
which will look at the root of your drive.
Upvotes: 1