mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 09:38:59 +02:00
Auto-generate markdown command docs (#4451)
* Finish updating * a couple improvements * Update renames * cleanup examples
This commit is contained in:
@ -1,61 +1,12 @@
|
||||
# from csv
|
||||
---
|
||||
title: from
|
||||
layout: command
|
||||
version: 0.59.0
|
||||
---
|
||||
|
||||
Converts content (string or binary) into a table. The source format is specified as a subcommand, like `from csv` or `from json`.
|
||||
Parse a string or binary data into structured data
|
||||
|
||||
Use this when nushell cannot determine the input file extension.
|
||||
## Signature
|
||||
|
||||
## Available Subcommands
|
||||
```> from ```
|
||||
|
||||
* from bson
|
||||
* [from csv](from-csv.md)
|
||||
* from eml
|
||||
* [from ics](from-ics.md)
|
||||
* [from ini](from-ini.md)
|
||||
* [from json](from-json.md)
|
||||
* [from ods](from-ods.md)
|
||||
* from sqlite
|
||||
* from ssv
|
||||
* [from toml](from-toml.md)
|
||||
* [from tsv](from-tsv.md)
|
||||
* [from url](from-url.md)
|
||||
* [from vcf](from-vcf.md)
|
||||
* [from xlsx](from-xlsx.md)
|
||||
* [from xml](from-xml.md)
|
||||
* [from yaml](from-yaml.md)
|
||||
|
||||
*Subcommands without links are currently missing their documentation.*
|
||||
|
||||
## Example for `from csv`
|
||||
|
||||
Let's say we have the following file:
|
||||
|
||||
```shell
|
||||
> cat pets.txt
|
||||
animal, name, age
|
||||
cat, Tom, 7
|
||||
dog, Alfred, 10
|
||||
chameleon, Linda, 1
|
||||
```
|
||||
|
||||
`pets.txt` is actually a .csv file but it has the .txt extension, `open` is not able to convert it into a table:
|
||||
|
||||
```shell
|
||||
> open pets.txt
|
||||
animal, name, age
|
||||
cat, Tom, 7
|
||||
dog, Alfred, 10
|
||||
chameleon, Linda, 1
|
||||
```
|
||||
|
||||
To get a table from `pets.txt` we need to use the `from csv` command:
|
||||
|
||||
```shell
|
||||
> open pets.txt | from csv
|
||||
━━━┯━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━
|
||||
# │ animal │ name │ age
|
||||
───┼───────────┼─────────┼──────
|
||||
0 │ cat │ Tom │ 7
|
||||
1 │ dog │ Alfred │ 10
|
||||
2 │ chameleon │ Linda │ 1
|
||||
━━━┷━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━
|
||||
```
|
||||
|
Reference in New Issue
Block a user