Skip to content

Commit

Permalink
save keyword, move sections into param descriptions & cross reference
Browse files Browse the repository at this point in the history
  • Loading branch information
sshanks-kx committed Oct 16, 2024
1 parent 2f30901 commit a97e84b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 31 deletions.
12 changes: 9 additions & 3 deletions docs/ref/doth.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ q).h.cd (`a`b`c;1 2 3;"xyz")
Columns can be nested vectors, in which case [`.h.d`](#hd-delimiter) is used to separate subitems. (Since V4.0 2020.03.17.)

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


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

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

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

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

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


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

## `.h.fram` (frame)

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

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


## `.h.xmp` (XMP)

Expand Down Expand Up @@ -865,4 +871,4 @@ foo| "bar"
```

:fontawesome-regular-hand-point-right:
[`.j` namespace](dotj.md) (JSON de/serialization)
[`.j` namespace](dotj.md) (JSON de/serialization), [save](save.md#save) (save and format data)
42 changes: 14 additions & 28 deletions docs/ref/save.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _Write global data to file or splayed to a directory_

## `save`

_Write a global variable to file_
_Write a global variable to file and optionally format data_

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

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

writes global variable/s `v` etc. to file and returns the filename/s.


### File path

If a file

- exists, it is overwritten
- does not exist, it is created, with any required parent directories


### Format

The format used depends on the file extension:

```txt
(none) binary
csv comma-separated values
txt plain text
xls Excel spreadsheet
xml Extensible Markup Language (XML)
json JavaScript Object Notation (JSON), available since v3.2 2014.07.31
```
writes global variable/s `v` etc. to file and returns the filename/s.

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

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

### Examples

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


### File path

If the file

- exists, it is overwritten
Expand Down

0 comments on commit a97e84b

Please sign in to comment.