2020-05-13 19:23:33 +02:00
|
|
|
# from ini
|
|
|
|
|
|
|
|
Converts ini data into table. Use this when nushell cannot determine the input file extension.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
Let's say we have the following `.txt` file:
|
|
|
|
|
2020-05-13 19:23:33 +02:00
|
|
|
```shell
|
|
|
|
> open sample.txt
|
|
|
|
[SectionOne]
|
|
|
|
|
|
|
|
key = value
|
|
|
|
integer = 1234
|
|
|
|
string1 = 'Case 1'
|
|
|
|
```
|
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
This file is actually a ini file, but the file extension isn't `.ini`. That's okay, we can use the `from ini` command:
|
2020-05-13 19:23:33 +02:00
|
|
|
|
|
|
|
```shell
|
|
|
|
> open sample.txt | from ini | get SectionOne
|
|
|
|
━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━
|
|
|
|
key │ integer │ string1
|
|
|
|
───────┼─────────┼──────────
|
|
|
|
value │ 1234 │ 'Case 1'
|
|
|
|
━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━
|
|
|
|
```
|