I'm learning clojure trought the book "The Clojure Wokshop - Packt" and i have stucked for a few days in this exercise:
(My IDE is IntelliJ and i'm using Windows).
Exercise 4.10: Importing Data from a CSV File
1. Create a folder somewhere convenient on your computer.
I decided to create an entirely new project given how many attempts i tried.
Is there any difference here while choosing between Leiningen or Deps? I most of the time use Leiningen, but should i use Deps because i am gonna use a deps.edn file?
2. Download the match_scores_1991-2016_UNINDEXED.csv file to the folder you created. (here on github)
But where should i download this file? Into the src file inside the project file or any file works? Is there any difference?
I decided to save inside de src.
3. In your editor, in the same folder, create a deps.edn file with the following contents:
{:deps
{org.clojure/data.csv {:mvn/version "0.1.4"}
semantic-csv {:mvn/version "0.2.1-alpha1"}}}
So, i created a deps.edn file.
4. Verify that everything is working by evaluating the following expression in your REPL:
user> (require '[clojure.data.csv :as csv])
nil
user> (require '[clojure.java.io :as io])
nil
user> (with-open [r (io/reader "match_scores_1991-2016_unindexed_csv.csv")]
(first (csv/read-csv r)))
When creating the REPL, should I select "Run with Intellij project classpath", right?
But when i am gonna evaluate the testing expressions, it shows an error while evaluating the second one and third one.
The error while evaluating the "clojure.data.csv :as csv" is this one:
Execution error (FileNotFoundException) at csv-example.core/eval1549 (form-init2604783929697477049.clj:1).
Could not locate clojure/data/csv__init.class, clojure/data/csv.clj or clojure/data/csv.cljc on classpath.
What am i missing? Have been trying for days to solve this but i didn't found any answer.
Thank you!