# csvlens

> Terminal CSV file viewer with spreadsheet-like navigation and filtering capabilities

Stars: 4.0k · Categories: Data

- Repository: https://github.com/YS-L/csvlens
- Page: https://www.trmn.sh/tools/csvlens

## Install

- Homebrew: `brew install csvlens`
- Cargo: `cargo install csvlens`
- Arch Linux: `pacman -S csvlens`

## Overview

csvlens is a terminal-based CSV file viewer that provides spreadsheet-like navigation for CSV data. It accepts CSV files as arguments or reads from stdin, making it suitable for piping data from other commands. The tool displays CSV data in a structured table format with vim-like navigation keybindings (hjkl) and supports standard paging controls.

The viewer includes filtering and search capabilities through regex patterns, allowing users to filter rows or columns with commands like `&<regex>` and `*<regex>`. It supports row sorting by column values, including natural ordering for alphanumeric data. Users can mark specific rows, copy selected cells to clipboard, and print filtered data to stdout. The tool handles different delimiters including auto-detection, tab-separated values, and custom separators.

Advanced features include column width adjustment, freezing columns from the left, line wrapping controls, and colored column display. The tool can be configured with command-line options for case-insensitive searching, custom prompts, and default filters. It also functions as a Rust library, enabling integration into other applications that need CSV viewing capabilities.

### Installation

```bash
# via Homebrew
brew install csvlens
```

```bash
# via Cargo
cargo install csvlens
```

```bash
# via Arch Linux
pacman -S csvlens
```

![csvlens demo showing CSV navigation](https://media.trmn.sh/cached/f81460b58b2eabaa840917fdb712f50aab97e14320275efcb4195b5260dc6165.gif)

## Alternatives

- [qsv](https://www.trmn.sh/tools/qsv.md): Rust CLI toolkit of composable commands for querying, transforming, validating, joining, and describing CSV, Excel, and other tabular data. (Rust, 3.8k stars)
- [gojq](https://www.trmn.sh/tools/gojq.md): Pure Go implementation of jq command-line JSON processor with arbitrary-precision arithmetic and YAML support (Go, 3.8k stars)
- [angle-grinder](https://www.trmn.sh/tools/angle-grinder.md): Command-line log analysis tool that parses, filters, and aggregates log data with a pipeline query language and a live-updating terminal UI. (Rust, 3.8k stars)
- [lazysql](https://www.trmn.sh/tools/lazysql.md): Cross-platform TUI database management tool for MySQL, PostgreSQL, SQLite, and MSSQL with SQL editor and table operations. (Go, 4.4k stars)
- [litecli](https://www.trmn.sh/tools/litecli.md): Command-line client for SQLite databases with auto-completion and syntax highlighting. (Python, 3.3k stars)

## Guides

- [Best CSV Tools for the Command Line](https://www.trmn.sh/best/csv-tools): Compare Miller, VisiData, xsv, qo and csvlens for querying, transforming and browsing CSV files from the terminal.

---

Canonical: https://www.trmn.sh/tools/csvlens
