I am trying to access a CSV file in Scala for validating the data in it. I succeeded in that. Now i want to dump all of that CSV file into a MongoDB database using the mongoimport utility of MongoDB. But I don't know how to execute this command from Scala. So, please can anyone tell me how to execute terminal commands from Scala?
My mongoimport command is as follows:
$ mongoimport -d dbname -c Colname --type csv --file Address.csv --headerline
Plese, suggest me any solution. Thanks in advance.