Watch this video to learn how to upload and parse CSV files with clojure.data.csv.
- [Instructor] In this video, we will write…the CSV parsing portion of our program.…We need to begin by defining our namespace,…we'll define this as web dot core,…and this program is small enough…that I just left it in one namespace.…For our require expression,…I'll pull in clojure dot data…dot CSV, for CSV parsing,…and I'll alias that to CSV.…Next, I'll pull in next dot cgrand dot enlive dash HTML,…and I'll alias this as ENL.…
This is the enlive library,…which we'll use for HTML generation and parsing later.…Next, I'll pull in the clojure Java IO, as IO,…and clojure dot string, as STR.…I'll use the gen-class keyword In an expression,…so that Leiningen can compile our program.…Now, I'm ready to begin programming the CSV portion.…I'll start with a function called parse CSV file,…and this will take a filename.…The CSV library gives us a function that will read a string,…and parse it as CSV, but we first need…to open a file to get its contents out.…
We can do that using a built-in function called slurp,…and I'm going to wrap it in a thread first macro,…
Skill Level Intermediate
1. Problem 1: Exploring Lake Pend Oreille
2. Problem 2: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Recursion and Directories
6. Problem 6: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.