https://github.com/susonicth/csvcut
a cut like tool to process csv files
https://github.com/susonicth/csvcut
command-line csv csv-file cut zig
Last synced: 3 months ago
JSON representation
a cut like tool to process csv files
- Host: GitHub
- URL: https://github.com/susonicth/csvcut
- Owner: SuSonicTH
- License: mit
- Created: 2024-05-06T11:22:21.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-03T21:05:32.000Z (about 1 year ago)
- Last Synced: 2025-01-03T22:21:42.642Z (about 1 year ago)
- Topics: command-line, csv, csv-file, cut, zig
- Language: Zig
- Homepage:
- Size: 184 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# csvcut
As a learning exercise to get to know zig I build a small command line tool that works like the *cut* utility but uses the header to identify columns additionaly to indices and has some extra functionality build in.
Feedback from more experienced zig developers is very welcome.
If you find any bug or you see some non-idiomatic costructs please let me know.
## Usage
see [src/USAGE.txt](src/USAGE.txt)
## Licence
csvcut is licensed under the MIT license
see [LICENSE.txt](LICENSE.txt)
## Build requirements
To build csvcut you just need the zig compiler, which can be downloaded from [https://ziglang.org/download/](https://ziglang.org/download/)
Currently zig 0.15.1 is supported, builds might break in never and older versions.
There is no installation needed, just download the package for your operating system an extract the archive and add it to your `PATH`
### Windows zig setup example for x86_64
execute following commands in a windows Command Prompt (cmd.exe)
```cmd
curl https://ziglang.org/download/0.15.1/zig-x86_64-windows-0.15.1.zip --output zig.zip
tar -xf zig.zip
del zig.zip
set PATH=%cd%\zig;%PATH%
```
### Linux zig setup example for x86_64
either install zig 0.15.1 with your package manager or
execute following commands in a shell
```bash
wget https://ziglang.org/download/0.15.1/zig-x86_64-linux-0.15.1.tar.xz
tar -xf zig-x86_64-linux-0.15.1.tar.xz
rm zig-x86_64-linux-0.15.1.tar.xz
export PATH=$(pwd)/zig-x86_64-linux-0.15.1.tar.xz:$PATH
```
## Build
If you have zig installed and on your `PATH` just cd into the directory and execute `zig build`
The first build takes a while and when it's finished you'll find the executeable (csvdiff or csvdiff.exe) in zig-out/bin/
You can run the built-in unit tests with `zig build test` If everything is ok you will see no output.
Use `zig build -Doption=ReleaseFast` to build a release version optimized for speed.