Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

📠 Pretty and fast csv viewer for cli with cjk/emoji support.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

wfxr/csview

Repository files navigation

A high performance csv viewer with cjk/emoji support.

CICDLicenseVersionPlatform

Features

  • Small andfast (seebenchmarks below).
  • Memory efficient.
  • Correctly alignCJK and emoji characters.
  • Supporttsv and custom delimiters.
  • Support different styles, including markdown table.

Usage

$ cat example.csvYear,Make,Model,Description,Price1997,Ford,E350,"ac, abs, moon",3000.001999,Chevy,"Venture ""Extended Edition""","",4900.001999,Chevy,"Venture ""Extended Edition, Large""",,5000.001996,Jeep,Grand Cherokee,"MUST SELL! air, moon roof",4799.00$ csview example.csv┌──────┬───────┬───────────────────────────────────┬───────────────────────────┬─────────┐│ Year │ Make  │               Model               │        Description        │  Price  │├──────┼───────┼───────────────────────────────────┼───────────────────────────┼─────────┤│ 1997 │ Ford  │ E350                              │ ac, abs, moon             │ 3000.00 ││ 1999 │ Chevy │ Venture "Extended Edition"        │                           │ 4900.00 ││ 1999 │ Chevy │ Venture "Extended Edition, Large" │                           │ 5000.00 ││ 1996 │ Jeep  │ Grand Cherokee                    │ MUST SELL! air, moon roof │ 4799.00 │└──────┴───────┴───────────────────────────────────┴───────────────────────────┴─────────┘$ head /etc/passwd | csview -H -d:┌────────────────────────┬───┬───────┬───────┬────────────────────────────┬─────────────────┐│ root                   │ x │ 0     │ 0     │                            │ /root           ││ bin                    │ x │ 1     │ 1     │                            │ /               ││ daemon                 │ x │ 2     │ 2     │                            │ /               ││ mail                   │ x │ 8     │ 12    │                            │ /var/spool/mail ││ ftp                    │ x │ 14    │ 11    │                            │ /srv/ftp        ││ http                   │ x │ 33    │ 33    │                            │ /srv/http       ││ nobody                 │ x │ 65534 │ 65534 │ Nobody                     │ /               ││ dbus                   │ x │ 81    │ 81    │ System Message Bus         │ /               ││ systemd-journal-remote │ x │ 981   │ 981   │ systemd Journal Remote     │ /               ││ systemd-network        │ x │ 980   │ 980   │ systemd Network Management │ /               │└────────────────────────┴───┴───────┴───────┴────────────────────────────┴─────────────────┘

Runcsview --help to view detailed usage.

Installation

On Arch Linux

csview is available in the Arch User Repository. To install it fromAUR:

yay -S csview

On macOS

You can installcsview with Homebrew:

brew install csview

On NetBSD

csview is available from the main pkgsrc Repositories. To install simply run

pkgin install csview

or, if you prefer to build from source usingpkgsrc on any of the supported platforms:

cd /usr/pkgsrc/textproc/csviewmake install

On Windows

You can installcsview withScoop:

scoop install csview

From binaries

Pre-built versions ofcsview for various architectures are available atGithub release page.

Note that you can try themusl version (which is statically-linked) if runs into dependency related errors.

From source

csview is also published oncrates.io. If you have latest Rust toolchains installed you can usecargo to install it from source:

cargo install --locked csview

If you want the latest version, clone this repository and runcargo build --release.

Benchmark

ToolCommandMean TimeMin TimeMemory
xsvxsv table small.csv2.0ms1.8ms3.9mb
csviewcsview small.csv0.3ms0.1ms2.4mb
columncolumn -s, -t small.csv1.3ms1.1ms2.4mb
csvlookcsvlook small.csv148.1ms142.4ms27.3mb
ToolCommandMean TimeMin TimeMemory
xsvxsv table medium.csv0.031s0.029s4.4mb
csviewcsview medium.csv0.017s0.016s2.8mb
columncolumn -s, -t small.csv0.052s0.050s9.9mb
csvlookcsvlook medium.csv2.664s2.617s46.8mb
  • large.csv (1,000,000 rows, 10 cols, 61M bytes, generated by concatenatingmedium.csv 100 times):
ToolCommandMean TimeMin TimeMemory
xsvxsv table large.csv2.912s2.820s4.4mb
csviewcsview large.csv1.686s1.665s2.8mb
columncolumn -s, -t small.csv5.777s5.759s767.6mb
csvlookcsvlook large.csv20.665s20.549s1105.7mb

F.A.Q.


We already havexsv, why not contribute to it but build a new tool?

xsv is great. But it's aimed for analyzing and manipulating csv data.csview is designed for formatting and viewing. See also:xsv/issues/156


I encountered UTF-8 related errors, how to solve it?

The file may use a non-UTF8 encoding. You can check the file encoding usingfile command:

$ file -i a.csva.csv: application/csv; charset=iso-8859-1

And then convert it toutf8:

$ iconv -f iso-8859-1 -t UTF8//TRANSLIT a.csv -o b.csv$ csview b.csv

Or do it in place:

$ iconv -f iso-8859-1 -t UTF8//TRANSLIT a.csv | csview

Credits

License

csview is distributed under the terms of both the MIT License and the Apache License 2.0.

See theLICENSE-APACHE andLICENSE-MIT files for license details.

About

📠 Pretty and fast csv viewer for cli with cjk/emoji support.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp