Wraps writing of file content.
Wraps writing of file content.
(csv-file target-dir file-name data)Writes data to a csv file. If target-dir does not exists, it is created before saving. File content in data should be represented as a sequence of sequences of strings. The data is stored by rows. File is saved to [target-dir]-[file-name]. Returns an absolute path to the target-dir.
(require '[utilities.writer :refer :all])
(csv-file "folder" "file.csv" [["header 1" "header 2"] ["row_1_col_1" "row_1_col_2"] ["row_2_col_1" "row_2_col_2"]])
Writes data to a csv file.
If target-dir does not exists, it is created before saving. File content
in data should be represented as a sequence of sequences of strings. The
data is stored by rows. File is saved to [target-dir]-[file-name].
Returns an absolute path to the target-dir.
## Usage
(require '[utilities.writer :refer :all])
(csv-file "folder"
"file.csv"
[["header 1" "header 2"]
["row_1_col_1" "row_1_col_2"]
["row_2_col_1" "row_2_col_2"]])
(txt-file target-dir file-name lines)Writes data to a text file. If target-dir does not exists, it is created before saving. File content in lines should be represented as a sequence of strings. File is saved to [target-dir]-[file-name]. Returns an absolute path to the target-dir.
(require '[utilities.writer :refer :all])
(txt-file "folder" "file.asc" ["line 1" "line 2" "line 3"])
Writes data to a text file.
If target-dir does not exists, it is created before saving. File content
in lines should be represented as a sequence of strings. File is saved
to [target-dir]-[file-name].
Returns an absolute path to the target-dir.
## Usage
(require '[utilities.writer :refer :all])
(txt-file "folder"
"file.asc"
["line 1"
"line 2"
"line 3"])cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |