Skip to content

Instantly share code, notes, and snippets.

@phondanai
Last active September 7, 2016 02:30
Show Gist options
  • Save phondanai/407b24d0a42587a5952e54b3530d8b95 to your computer and use it in GitHub Desktop.
Save phondanai/407b24d0a42587a5952e54b3530d8b95 to your computer and use it in GitHub Desktop.
Split and count from text input
#lang racket
(define c 0)
(with-input-from-file "/path/to/file"
(thunk
(for ([line (in-lines)])
(set! c
(+ c
(length
(string-split line "|||")))))))
(displayln c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment