2019-11-29 18:15:51 +01:00
# save
2020-07-13 08:39:36 +02:00
This command saves the contents of the pipeline to a file. Use this in combination with the `to json` , `to csv` , ... commands to save the contents in the specified format.
2019-11-29 18:15:51 +01:00
Syntax: `save (path) {flags}`
2020-06-23 20:21:47 +02:00
## Parameters
2019-11-29 18:15:51 +01:00
* `(path)` the path to save contents to
### Flags
--raw
treat values as-is rather than auto-converting based on file extension
## Example
You can save the name of files in a directory like this:
```shell
2020-05-07 13:03:43 +02:00
> ls | where type == File | select name | save filenames.csv
2019-11-29 18:15:51 +01:00
```
2020-05-04 10:44:33 +02:00
Or you can format it in supported formats using one of the `to` commands:
2019-11-29 18:15:51 +01:00
```shell
2020-05-07 13:03:43 +02:00
> ls | where type == File | select name | to csv | save filenames
2019-11-30 21:07:43 +01:00
```
2020-06-23 20:21:47 +02:00
`filename.csv` and `filenames` are both `csv` formatted files. Nu auto-converts the format if a supported file extension is given.