https://github.com/berquerant/csv2json
Convert csv data from stdin into json.
https://github.com/berquerant/csv2json
zig
Last synced: 12 months ago
JSON representation
Convert csv data from stdin into json.
- Host: GitHub
- URL: https://github.com/berquerant/csv2json
- Owner: berquerant
- License: mit
- Created: 2022-11-22T03:05:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-28T12:58:57.000Z (over 3 years ago)
- Last Synced: 2025-03-31T11:31:18.469Z (about 1 year ago)
- Topics: zig
- Language: Zig
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csv2json
Convert csv data from stdin into json.
```
$ cat account.csv
id,name,department
1,account1,HR
2,account2,Dev
4,account4,HR
3,account3,PR
$ csv2json -i < account.csv
{"id":1,"name":"account1","department":"HR"}
{"id":2,"name":"account2","department":"Dev"}
{"id":4,"name":"account4","department":"HR"}
{"id":3,"name":"account3","department":"PR"}
$ csv2json < account.csv
["id","name","department"]
[1,"account1","HR"]
[2,"account2","Dev"]
[4,"account4","HR"]
[3,"account3","PR"]
```
## Package management
Depends on:
- [build.zig](./build.zig)
- [requirements.txt](./requirements.txt)
- [package.sh](./package.sh)
The format of a row of requirements.txt is:
```
LOCATION VERSION ENTRANCE
```
`LOCATION` is a part of the repo url with schema stripped.
`VERSION` is a tag or a commit hash.
`ENTRANCE` is a target zig file to `@import`, relative to the root of the repo.
## Requirements
- zig 0.10.0 or later