Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:11:50+00:00 2026-06-05T01:11:50+00:00

How do I download and parse a csv file in Racket?

  • 0

How do I download and parse a csv file in Racket?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:11:51+00:00Added an answer on June 5, 2026 at 1:11 am

    Use get-pure-port to download the file, and use the Planet library (require (planet neil/csv)) to parse it.

    The following example downloads and parses a csv file containing
    data on the size of the various Galapagos islands and how many species were found on each island.

    #lang racket
    (require (planet neil/csv:1:=7) net/url)
    
    (define galapagos-url 
      (string->url
       "http://www.stat.washington.edu/~handcock/536/Data/galapagos.csv"))
    
    (define make-galapagos-csv-reader
      (make-csv-reader-maker
       '((separator-chars              #\,)
         (strip-leading-whitespace?  . #t)
         (strip-trailing-whitespace? . #t))))
    
    (define (all-rows url make-reader)
      (define next-row (make-reader (get-pure-port url)))
      (define (loop)
        (define row (next-row))
        (if (empty? row)
            '()
            (cons row (loop))))
      (loop))
    
    (all-rows galapagos-url make-galapagos-csv-reader)
    

    The first rows returned are:

    '(("Island"
       "Observed.species"
       "Native.species"
       "Area(km^2)"
       "Elevation(m)"
       "Distance.nearest.island(km)"
       "Distance.Santa.Cruz(km)"
       "Area.adj.island(km^2)")
      ("Baltra" "58" "23" "25.09" "" "0.6" "0.6" "1.84")
      ("Bartolome" "31" "21" "1.24" "109" "0.6" "26.3" "572.33")
      ("Caldwell" "3" "3" "0.21" "114" "2.8" "58.7" "0.78")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java server app that download CSV file and parse it. The
I am trying to download a .csv file into an array and then parse
I'm trying to get a csv file from http://download.finance.yahoo.com/d/quotes.csv?s=msft&f=sl1p2 then parse it so that
I have to download and parse some file and put create list of object
I want to parse the contents of a dynamic .csv file. However, this code
I'm trying to download CSV content from morningstar and then parse its contents. If
i want to download a csv file from a internet url. I have tried
Is it possible to download and parse a plain text file from different domain
What language and libraries are suitable for a script to parse and download small
I am trying to parse an RSS feed and download all of the images

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.