Skip to content

Commit a97e84b

Browse files
committed
save keyword, move sections into param descriptions & cross reference
1 parent 2f30901 commit a97e84b

File tree

2 files changed

+23
-31
lines changed

2 files changed

+23
-31
lines changed

docs/ref/doth.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ q).h.cd (`a`b`c;1 2 3;"xyz")
9494
Columns can be nested vectors, in which case [`.h.d`](#hd-delimiter) is used to separate subitems. (Since V4.0 2020.03.17.)
9595

9696
:fontawesome-regular-hand-point-right:
97-
[0: load csv](file-text.md#load-csv)
97+
[0: load csv](file-text.md#load-csv), [save](save.md#save) (save and format data)
9898

9999

100100
## `.h.code` (code after Tab)
@@ -161,6 +161,8 @@ q).h.ed ([]a:1 2 3;b:`x`y`z)
161161
"<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:o=\"u..
162162
```
163163

164+
:fontawesome-regular-hand-point-right:
165+
[save](save.md#save) (save and format data)
164166

165167
## `.h.edsn` (Excel from tables)
166168

@@ -203,7 +205,8 @@ q)`:/Users/sjt/tmp/excel.xls 0: .h.edsn `test1`test2!(t1;t2)
203205

204206
![excel.xls](../img/h.edsn.png "Excel spreadsheet")
205207

206-
208+
:fontawesome-regular-hand-point-right:
209+
[save](save.md#save) (save and format data)
207210

208211
## `.h.fram` (frame)
209212

@@ -819,6 +822,9 @@ q).h.xd ([]a:1 2 3;b:`x`y`z)
819822
"</R>"
820823
```
821824

825+
:fontawesome-regular-hand-point-right:
826+
[save](save.md#save) (save and format data)
827+
822828

823829
## `.h.xmp` (XMP)
824830

@@ -865,4 +871,4 @@ foo| "bar"
865871
```
866872

867873
:fontawesome-regular-hand-point-right:
868-
[`.j` namespace](dotj.md) (JSON de/serialization)
874+
[`.j` namespace](dotj.md) (JSON de/serialization), [save](save.md#save) (save and format data)

docs/ref/save.md

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _Write global data to file or splayed to a directory_
1111

1212
## `save`
1313

14-
_Write a global variable to file_
14+
_Write a global variable to file and optionally format data_
1515

1616
```syntax
1717
save x save[x]
@@ -20,35 +20,24 @@ save x save[x]
2020
Where `x` is a symbol atom or vector of the form `[path/to/]v[.ext]` in which
2121

2222
- `v` is the name of a global variable
23-
- `path/to/` is a file path (optional)
24-
- `.ext` is a file extension (optional)
23+
- `path/to/` is a file path (optional). If a file
24+
- exists, it is overwritten
25+
- does not exist, it is created, with any required parent directories
26+
- `.ext` is a file extension (optional) which effects the file content format. Options are:
27+
- `(none)` for binary format
28+
- `csv` for comma-separated values
29+
- `txt` for plain text)
30+
- `xls` for Excel spreadsheet format
31+
- `xml` for Extensible Markup Language (XML))
32+
- `json` for JavaScript Object Notation (JSON) Since v3.2 2014.07.31.
2533

26-
writes global variable/s `v` etc. to file and returns the filename/s.
27-
28-
29-
### File path
30-
31-
If a file
32-
33-
- exists, it is overwritten
34-
- does not exist, it is created, with any required parent directories
3534

36-
37-
### Format
38-
39-
The format used depends on the file extension:
40-
41-
```txt
42-
(none) binary
43-
csv comma-separated values
44-
txt plain text
45-
xls Excel spreadsheet
46-
xml Extensible Markup Language (XML)
47-
json JavaScript Object Notation (JSON), available since v3.2 2014.07.31
48-
```
35+
writes global variable/s `v` etc. to file and returns the filename/s.
4936

5037
!!! tip "There are no corresponding formats for [`load`](load.md). Instead, use [File Text](file-text.md)."
5138

39+
:fontawesome-regular-hand-point-right:
40+
[.h](doth.md) (data serialization tools)
5241

5342
### Examples
5443

@@ -131,9 +120,6 @@ rsave x rsave[x]
131120
Where `x` is a table name as a symbol atom, saves the table, in binary format, splayed to a directory of the same name.
132121
The table must be fully enumerated and not keyed.
133122

134-
135-
### File path
136-
137123
If the file
138124

139125
- exists, it is overwritten

0 commit comments

Comments
 (0)