Skip to content

Reading and writing CSV files from Racket... Except easier.

License

Notifications You must be signed in to change notification settings

sleibrock/ez-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ez-csv

Reading and writing CSV files made painless and easy. Drops into any kind or Racket code base easily.

  • Easy to incorporate CSV logic into your pre-existing code
  • Converts to plain lists or pre-defined structures (struct/define-struct)
  • Customizable delimiters
  • MIT License, share with your friends / family / co-workers / pets.
  • Can be lazy or non-lazy Racket.
#lang racket

; Load the ez-csv library
(require ez-csv)

; Create our CSV struct
(defrec NinjaWeapon
  ["Name of Weapon" "Material" "Color"]
  [name material color]
  ",")

; Load in your CSV text file
(define weapons-closet (file->NinjaWeapons "weapon_closet.csv"))

; Treat it like you would any regular list type
(for-each
 (lambda (item)
   (displayln (NinjaWeapon-name item)))
 weapons-closet)

; Katana
; Nunchuku
; Throwing Star
; ...

Todo List

  1. Add lazy-reading method for stream/generator purposes
  2. Add ability to include headers for CSV output

About

Reading and writing CSV files from Racket... Except easier.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages