Liking cljdoc? Tell your friends :D

clj-ml.utils.io


find-field-namesclj

(find-field-names file-path delimiter)

Finds the names of the fields of an XSV file

Finds the names of the fields of an XSV file
raw docstring

maps->xsv-dataclj

(maps->xsv-data delimiter maps)

Takes a collection of maps and returns csv-data (vector of vectors with all values).

Takes a collection of maps and returns csv-data 
(vector of vectors with all values).
raw docstring

read-file-linesclj

(read-file-lines file-path)

Reads a file from the file-path and returns a lazy sequence of strings

Reads a file from the `file-path` and returns a lazy sequence of strings
raw docstring

row->mapclj

(row->map rows delimiter field-names result)

Takes rows as a collection, fetches it's first row, Splits it on delimiter, Coverts the resulting row into a map by using keys from field-names, And then finally appends it to the result

Takes `rows` as a collection, fetches it's first row,
Splits it on `delimiter`,
Coverts the resulting row into a map by using keys from `field-names`,
And then finally appends it to the `result`
raw docstring

write-xsvclj

(write-xsv file xsv-data)

Takes a file (path, name and extension) and csv-data (vector of vectors with all values) and writes csv file.

Takes a file (path, name and extension) and 
csv-data (vector of vectors with all values) and
writes csv file.
raw docstring

write-xsv-from-mapsclj

(write-xsv-from-maps file maps)
(write-xsv-from-maps file maps delimiter)

Takes a file (path, name and extension) and a collection of maps transforms data (vector of vectors with all values) writes csv file. Optionall provide a delimiter, defaults to ,

Takes a file (path, name and extension) and a collection of maps
transforms data (vector of vectors with all values) 
writes csv file.
Optionall provide a delimiter, defaults to `,`
raw docstring

xsv-readerclj

(xsv-reader file-path)
(xsv-reader file-path has-field-names?)
(xsv-reader file-path has-field-names? delimiter)
(xsv-reader file-path has-field-names? delimiter field-names)

Reads an XSV file and generates a collection of maps where each map in the colection represent a row with the keys as the column names and it's values as the row's values NOTE: X represents a delimiter file-path is the XSV file's path delimiter is the delimiter value used in the XSV file, the default value of it is , field-names is the collection of column names of the XSV file If it is not supplied, the function will read it from the first row of the file

Reads an XSV file and generates a collection of maps where each map in the colection
represent a row with the keys as the column names and it's values as the row's values
NOTE: X represents a delimiter
`file-path` is the XSV file's path
`delimiter` is the delimiter value used in the XSV file, the default value of it is `,`
`field-names` is the collection of column names of the XSV file
If it is not supplied, the function will read it from the first row of the file
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close