All Projects â†’ wfxr â†’ Csview

wfxr / Csview

Licence: other
📠 A high performance csv viewer with cjk/emoji support.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Csview

Pastel
A command-line tool to generate, analyze, convert and manipulate colors
Stars: ✭ 3,742 (+1699.04%)
Mutual labels:  cli, terminal, command-line, tool
Laravel Zero
A PHP framework for console artisans
Stars: ✭ 2,821 (+1256.25%)
Mutual labels:  cli, terminal, command-line, tool
Teip
Select partial standard input and replace with the result of another command efficiently
Stars: ✭ 280 (+34.62%)
Mutual labels:  cli, terminal, command-line, tool
Fd
A simple, fast and user-friendly alternative to 'find'
Stars: ✭ 19,851 (+9443.75%)
Mutual labels:  cli, terminal, command-line, tool
Tably
Python command-line script for converting .csv data to LaTeX tables
Stars: ✭ 173 (-16.83%)
Mutual labels:  cli, command-line, csv, table
Lucid
A simple mock-application for programs that work with child processes
Stars: ✭ 45 (-78.37%)
Mutual labels:  cli, terminal, command-line, tool
Bat
A cat(1) clone with wings.
Stars: ✭ 30,833 (+14723.56%)
Mutual labels:  cli, terminal, command-line, tool
Fsq
A tool for querying the file system with a SQL-like language.
Stars: ✭ 60 (-71.15%)
Mutual labels:  cli, terminal, command-line, tool
Word Wrap
Wrap words to a specified length.
Stars: ✭ 107 (-48.56%)
Mutual labels:  cli, terminal, command-line
Httpcat
httpcat is a simple utility for constructing raw HTTP requests on the command line.
Stars: ✭ 109 (-47.6%)
Mutual labels:  cli, terminal, command-line
Typin
Declarative framework for interactive CLI applications
Stars: ✭ 126 (-39.42%)
Mutual labels:  cli, terminal, command-line
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-50.96%)
Mutual labels:  cli, command-line, csv
Rundeck Cli
CLI tool for Rundeck
Stars: ✭ 98 (-52.88%)
Mutual labels:  cli, command-line, tool
Nnn
n³ The unorthodox terminal file manager
Stars: ✭ 13,138 (+6216.35%)
Mutual labels:  cli, terminal, command-line
Tooling
Advancing Node.js as a framework for writing great tools
Stars: ✭ 98 (-52.88%)
Mutual labels:  cli, terminal, command-line
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+2230.29%)
Mutual labels:  cli, terminal, tool
Saldl
A lightweight well-featured CLI downloader optimized for speed and early preview.
Stars: ✭ 203 (-2.4%)
Mutual labels:  cli, terminal, command-line
Run
âš¡The resource runtime
Stars: ✭ 90 (-56.73%)
Mutual labels:  cli, terminal, command-line
Proji
A powerful cross-platform CLI project templating tool.
Stars: ✭ 156 (-25%)
Mutual labels:  cli, command-line, tool
Ascii
👾 ASCII Roulette :: ascii art video chat on the cli
Stars: ✭ 202 (-2.88%)
Mutual labels:  cli, terminal, command-line

📠 csview

A high performance csv viewer with cjk/emoji support.

CICD License Version Platform

Features

  • Small and fast (see benchmarks below).
  • Correctly handles CJK characters and emoji.
  • Support different styles.
  • Support tsv and custom delimiters.
  • Able to generate markdown table (with --style markdown option).

Usage

$ cat 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, Very Large""",,5000.00
1996,Jeep,Grand Cherokee,"MUST SELL!
air, moon roof, loaded",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, Very Large" |                        | 5000.00 |
| 1996 | Jeep  | Grand Cherokee                         | MUST SELL!             | 4799.00 |
|      |       |                                        | air, moon roof, loaded |         |
+------+-------+----------------------------------------+------------------------+---------+

$ head -n10 /etc/passwd | csview --no-headers -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 | 982   | 982   | systemd Journal Remote     | /               |
| systemd-network        | x | 981   | 981   | systemd Network Management | /               |
+------------------------+---+-------+-------+----------------------------+-----------------+

Run csview --help to view detailed usage.

Installation

On Arch Linux

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

yay -S csview

On macOS

You can install csview with Homebrew:

brew tap wfxr/csview
brew install csview

On Windows

You can install csview with Scoop:

scoop install csview

From binaries

Pre-built versions of csview for various architectures are available at Github release page.

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

From source

csview is also published on crates.io. If you have Rust toolchains (1.40 or above) installed you can use cargo to install it from source:

cargo install --locked csview

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

Benchmark

Compared with csvlook provided by csvkit:

Benchmark #1: csvlook sample.csv
  Time (mean ± σ):      4.010 s ±  0.100 s    [User: 3.945 s, System: 0.051 s]
  Range (min … max):    3.911 s …  4.249 s    10 runs

Benchmark #2: csview sample.csv
  Time (mean ± σ):      46.5 ms ±   2.3 ms    [User: 39.7 ms, System: 6.5 ms]
  Range (min … max):    44.0 ms …  59.4 ms    59 runs

Summary
  'csview sample.csv' ran
   86.32 ± 4.83 times faster than 'csvlook sample.csv'
Benchmark #1: csvlook action.csv
  Time (mean ± σ):     316.5 ms ±   5.2 ms    [User: 284.8 ms, System: 35.0 ms]
  Range (min … max):   309.3 ms … 326.2 ms    10 runs

Benchmark #2: csview action.csv
  Time (mean ± σ):       0.7 ms ±   0.2 ms    [User: 0.8 ms, System: 0.7 ms]
  Range (min … max):     0.4 ms …   1.6 ms    933 runs

Summary
  'csview action.csv' ran
  461.25 ± 109.34 times faster than 'csvlook action.csv'

F.A.Q.


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

xsv is an awesome csv tookit. It's aimed for analyzing and manipulating csv data. csview is designed for formatting and viewing. Their relationship is like awk and column.

The author of xsv may have the similar views with me: https://github.com/BurntSushi/xsv/issues/156


Things look weird if the width of table is more than the width of terminal window.

Use pager less with -S option: csview a.csv | less -S so you can scroll screen horizontally. Or use xsv to filter out the columns you don't care then piped to csview.


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

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

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

And then convert it to utf8:

$ 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 the LICENSE-APACHE and LICENSE-MIT files for license details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].