2020-05-04 23:01:31 +02:00
|
|
|
# from tsv
|
2019-11-30 13:38:52 +01:00
|
|
|
|
|
|
|
Parse text as `.tsv` and create table.
|
|
|
|
|
2020-05-04 23:01:31 +02:00
|
|
|
Syntax: `from tsv {flags}`
|
2019-11-30 13:38:52 +01:00
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
## Flags
|
2019-11-30 13:38:52 +01:00
|
|
|
|
|
|
|
--headerless
|
|
|
|
don't treat the first row as column names
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Let's say we have the following file which is formatted like a `tsv` file:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> open elements.txt
|
|
|
|
Symbol Element
|
|
|
|
H Hydrogen
|
|
|
|
He Helium
|
|
|
|
Li Lithium
|
|
|
|
Be Beryllium
|
|
|
|
```
|
|
|
|
|
2020-05-04 23:01:31 +02:00
|
|
|
If we pass the output of the `open` command to `from tsv` we get a correct formatted table:
|
2019-11-30 13:38:52 +01:00
|
|
|
|
|
|
|
```shell
|
2020-05-04 23:01:31 +02:00
|
|
|
> open elements.txt | from tsv
|
2019-11-30 13:38:52 +01:00
|
|
|
━━━┯━━━━━━━━┯━━━━━━━━━━━
|
|
|
|
# │ Symbol │ Element
|
|
|
|
───┼────────┼───────────
|
|
|
|
0 │ H │ Hydrogen
|
|
|
|
1 │ He │ Helium
|
|
|
|
2 │ Li │ Lithium
|
|
|
|
3 │ Be │ Beryllium
|
|
|
|
━━━┷━━━━━━━━┷━━━━━━━━━━━
|
|
|
|
```
|
|
|
|
|
|
|
|
Using the `--headerless` flag has the following output:
|
|
|
|
|
|
|
|
```shell
|
2020-05-04 23:01:31 +02:00
|
|
|
> open elements.txt | from tsv --headerless
|
2019-11-30 13:38:52 +01:00
|
|
|
━━━━┯━━━━━━━━━┯━━━━━━━━━━━
|
|
|
|
# │ Column1 │ Column2
|
|
|
|
────┼─────────┼───────────
|
|
|
|
0 │ Symbol │ Element
|
|
|
|
1 │ H │ Hydrogen
|
|
|
|
2 │ He │ Helium
|
|
|
|
3 │ Li │ Lithium
|
|
|
|
4 │ Be │ Beryllium
|
|
|
|
━━━━┷━━━━━━━━━┷━━━━━━━━━━━
|
2020-05-04 23:01:31 +02:00
|
|
|
```
|