Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brudgers/clojure-data-in
https://github.com/brudgers/clojure-data-in
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/brudgers/clojure-data-in
- Owner: brudgers
- License: epl-1.0
- Created: 2015-03-12T18:13:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-12T18:17:12.000Z (over 9 years ago)
- Last Synced: 2023-07-31T16:36:48.315Z (over 1 year ago)
- Language: Clojure
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction to data-in
The purpose of `data-in` is to read all the lines from a text file and return the file's contents as a Clojure value in a standardized manner.# Specification
###Takes:
+ `Filename`###Assumes:
+ a space delimited text file###Returns:
+ Vector **[L1,L2,...Ln]** where **Li**:
+ represents a line in `Filename`
+ is a vector
+ contains EDN values# Example:
If `my-file.txt` contains:3 9
5 4
6 5
3 2then `(data-in "./my-file.txt")` returns:
`[[3 9] [5 4] [6 5] [3 2]]`
# Comments
To avoid executing arbitrary code, `data-in` reads values from files with `clojure.edn/read-string`.The input is not read lazily.