"CSVI" - Terminal CSV Editor .

GoDev

<English> / <Japanese>

As of version 1.6.0, CSView has been renamed to CSVI to avoid conflicts with other tools using the same name.

CSVI is a terminal-based CSV editor for Linux and Windows.
macOS is also supported experimentally, as the developer does not have direct access to a macOS environment.
→ You can try it from v1.13.0

✨ Key Features .

image

Video by @emisjerry

Install .

Manual Installation .

Download the binary package from Releases and extract the executable.

⚠️ Note: The macOS build is experimental and not yet tested. Please let us know if you encounter any issues!

Use "go install" .

go install github.com/hymkor/csvi/cmd/csvi@latest

Use scoop-installer (Windows only) .

scoop install https://raw.githubusercontent.com/hymkor/csvi/master/csvi.json

or

scoop bucket add hymkor https://github.com/hymkor/scoop-bucket
scoop install csvi

Usage .

$ csvi {options} FILENAME(...)

or

$ cat FILENAME | csvi {options}

Options

Key-binding .

Readline with SKK1 .

When the environment variable GOREADLINESKK is defined, go-readline-skk is used.

(Note: ~ is automatically expanded to %USERPROFILE% on Windows, even in cmd.exe.)

Use as a Go package .

package main

import (
    "fmt"
    "os"
    "strings"

    "github.com/mattn/go-colorable"

    "github.com/hymkor/csvi"
    "github.com/hymkor/csvi/uncsv"
)

func main() {
    source := `A,B,C,D
"A1","B1","C1","D1"
"A2","B2","C2","D2"`

    cfg := &csvi.Config{
        Mode: &uncsv.Mode{Comma: ','},
    }

    result, err := cfg.Edit(strings.NewReader(source), colorable.NewColorableStdout())

    if err != nil {
        fmt.Fprintln(os.Stderr, err.Error())
        os.Exit(1)
    }

    // // env GOEXPERIMENT=rangefunc go run example
    // for row := range result.Each {
    //     os.Stdout.Write(row.Rebuild(cfg.Mode))
    // }
    result.Each(func(row *uncsv.Row) bool {
        os.Stdout.Write(row.Rebuild(cfg.Mode))
        return true
    })
}

Release Note .

Acknowledgements .

Author .


  1. Simple Kana to Kanji conversion program. One of the Japanese input method editor. ↩︎