mirror of
https://github.com/nushell/nushell.git
synced 2024-11-25 09:53:43 +01:00
22e70478a4
This adds a top-level document for the new `to` command, with a list (of links) of all the subcommands. All the to-* subcommands keep their filename, but the content is updated to use the new subcommand syntax. Since not all subcommands have documentation, some items in the list are just text without a link. Also filled the list for the undocumented from* commands in the same style. Fixes #1709
1.5 KiB
1.5 KiB
from-csv
Converts content (string or binary) into a table. The source 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 bson
- from csv
- from eml
- from ics
- from ini
- from json
- from ods
- from sqlite
- from ssv
- from toml
- from tsv
- from url
- from vcf
- from xlsx
- from xml
- from yaml
Subcommands without links are currently missing their documentation.
Example for from csv
Let's say we have the following file :
> 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 :
> 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:
> open pets.txt | from csv
━━━┯━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━
# │ animal │ name │ age
───┼───────────┼─────────┼──────
0 │ cat │ Tom │ 7
1 │ dog │ Alfred │ 10
2 │ chameleon │ Linda │ 1
━━━┷━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━