forked from nushell/nushell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs/commands: add from.md, update subcommands (nushell#1712)
This adds a top-level document for the new `from` command, with a list of links of all the subcommands. All the from-* subcommands keep their filename, but the content is updated to use the new subcommand syntax. Needs matching update for to* Ref nushell#1709
- Loading branch information
1 parent
3201c90
commit 8ab2b92
Showing
11 changed files
with
111 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# from-csv | ||
|
||
Converts content (string or binary) into a table. The format is specified as a subcommand, like `from csv` or `from json`. | ||
|
||
Use this when nushell cannot determine the input file extension. | ||
|
||
## Available Subcommands | ||
|
||
* [from csv](from-csv.md) | ||
* [from ics](from-ics.md) | ||
* [from json](from-json.md) | ||
* [from ods](from-ods.md) | ||
* [from toml](from-toml.md) | ||
* [from tsv](from-tsv.md) | ||
* [from vcf](from-vcf.md) | ||
* [from xlsx](from-csv.md) | ||
* [from yaml](from-yaml.md) | ||
|
||
## 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 | ||
━━━┷━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━ | ||
``` |