{"id":13468973,"url":"https://github.com/YS-L/csvlens","last_synced_at":"2025-03-26T05:31:27.004Z","repository":{"id":38846242,"uuid":"396072317","full_name":"YS-L/csvlens","owner":"YS-L","description":"Command line csv viewer","archived":false,"fork":false,"pushed_at":"2024-10-20T05:37:46.000Z","size":2804,"stargazers_count":2586,"open_issues_count":37,"forks_count":43,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-10-29T15:10:52.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YS-L.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-14T16:59:09.000Z","updated_at":"2024-10-26T23:44:41.000Z","dependencies_parsed_at":"2022-07-18T02:17:01.640Z","dependency_job_id":"86c41055-a7c6-4d75-ba0e-fe51e214fe0a","html_url":"https://github.com/YS-L/csvlens","commit_stats":{"total_commits":173,"total_committers":6,"mean_commits":"28.833333333333332","dds":0.05780346820809246,"last_synced_commit":"df726b6368e41b23a1bd8f8965318d2df549d0e3"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YS-L%2Fcsvlens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YS-L%2Fcsvlens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YS-L%2Fcsvlens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YS-L%2Fcsvlens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YS-L","download_url":"https://codeload.github.com/YS-L/csvlens/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245543411,"owners_count":20632648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:01:23.138Z","updated_at":"2025-03-26T05:31:26.998Z","avatar_url":"https://github.com/YS-L.png","language":"Rust","funding_links":[],"categories":["Rust","Command line","\u003ca name=\"data-management-tabular\"\u003e\u003c/a\u003eData management - Tabular data","Table of Contents","File","💻 Apps","Developer Tools"],"sub_categories":["🚀 Productivity and Utilities"],"readme":"# csvlens\n\n`csvlens` is a command line CSV file viewer. It is like `less` but made\nfor CSV.\n\n![Demo](.github/demo.gif)\n\n## Usage\n\nRun `csvlens` by providing the CSV filename:\n\n```\ncsvlens \u003cfilename\u003e\n```\n\nPipe CSV data directly to `csvlens`:\n\n```\n\u003cyour commands producing some csv data\u003e | csvlens\n```\n### Key bindings\n\nKey | Action\n--- | ---\n`hjkl` (or `← ↓ ↑→ `) | Scroll one row or column in the given direction\n`Ctrl + f` (or `Page Down`) | Scroll one window down\n`Ctrl + b` (or `Page Up`) | Scroll one window up\n`Ctrl + d` (or `d`) | Scroll half a window down\n`Ctrl + u` (or `u`) | Scroll half a window up\n`Ctrl + h` | Scroll one window left\n`Ctrl + l` | Scroll one window right\n`Ctrl + ←` | Scroll left to first column\n`Ctrl + →` | Scroll right to last column\n`G` (or `End`) | Go to bottom\n`g` (or `Home`) | Go to top\n`\u003cn\u003eG` | Go to line `n`\n`/\u003cregex\u003e` | Find content matching regex and highlight matches\n`n` (in Find mode) | Jump to next result\n`N` (in Find mode) | Jump to previous result\n`\u0026\u003cregex\u003e` | Filter rows using regex (show only matches)\n`*\u003cregex\u003e` | Filter columns using regex (show only matches)\n`TAB` | Toggle between row, column or cell selection modes\n`\u003e` | Increase selected column's width\n`\u003c` | Decrease selected column's width\n`Shift + ↓` (or `Shift + j`) | Sort rows or toggle sort direction by the selected column\n`#` (in Cell mode) | Find and highlight rows like the selected cell\n`@` (in Cell mode) | Filter rows like the selected cell\n`y` | Copy the selected row or cell to clipboard\n`Enter` (in Cell mode) | Print the selected cell to stdout and exit\n`-S` | Toggle line wrapping\n`-W` | Toggle line wrapping by words\n`f\u003cn\u003e` | Freeze this number of columns from the left\n`r` | Reset to default view (clear all filters and custom column widths)\n`H` (or `?`) | Display help\n`q` | Exit\n\n### Optional parameters\n\n* `-d \u003cchar\u003e`: Use this delimiter when parsing the CSV\n  (e.g. `csvlens file.csv -d '\\t'`).\n\n  Specify `-d auto` to auto-detect the delimiter.\n\n* `-t`, `--tab-separated`: Use tab as the delimiter (when specified, `-d` is ignored).\n\n* `-i`, `--ignore-case`: Ignore case when searching. This flag is ignored if any\n  uppercase letters are present in the search string.\n\n* `--no-headers`: Do not interpret the first row as headers.\n\n* `--columns \u003cregex\u003e`: Use this regex to select columns to display by default.\n\n* `--filter \u003cregex\u003e`: Use this regex to filter rows to display by default.\n\n* `--find \u003cregex\u003e`: Use this regex to find and highlight matches by default.\n\n* `--echo-column \u003ccolumn_name\u003e`: Print the value of this column at the selected\n  row to stdout on `Enter` key and then exit.\n\n## Installation\n\n### Direct download\n\nYou can download the `tar.xz` or `zip` file matching your operating system from the\n[releases page](https://github.com/YS-L/csvlens/releases), extract it and execute the `csvlens`\nbinary.\n\n### Homebrew\n\nFor macOS, `csvlens` is available on [Homebrew](https://formulae.brew.sh/formula/csvlens). You can\ninstall it using:\n```\nbrew install csvlens\n```\n\n### Arch Linux\n`csvlens` is available in the [official repositories](https://archlinux.org/packages/extra/x86_64/csvlens). You can install it using:\n```\npacman -S csvlens\n```\n\n### Windows\n\nFor Windows, `csvlens` is available on [winget](https://learn.microsoft.com/en-gb/windows/package-manager/). You can install it using:\n```powershell\nwinget install --id YS-L.csvlens\n```\n\n### FreeBSD\n`csvlens` is available as a [FreeBSD pkg](https://www.freshports.org/textproc/csvlens/). You can install it using:\n```\npkg install csvlens\n```\n\n### NetBSD\n`csvlens` is available on [pkgsrc](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/textproc/csvlens/index.html). If you're using NetBSD you can install it using:\n```\npkgin install csvlens\n```\n\n### OpenBSD\n`csvlens` is available as an [OpenBSD port](https://cvsweb.openbsd.org/ports/textproc/csvlens/). If you're using OpenBSD 7.6-current or later, you can install it using:\n```\ndoas pkg_add csvlens\n```\n\n### Cargo\n\nIf you have [Rust](https://www.rust-lang.org/tools/install) installed, `csvlens` is available on\n[crates.io](https://crates.io/crates/csvlens) and you can install it using:\n```\ncargo install csvlens\n```\n\nOr, build and install from source after cloning this repo:\n```\ncargo install --path $(pwd)\n```\n\n## Library Usage\n\nThis crate allows you to use csvlens as a library.\n\nIn your `Cargo.toml`, add the following:\n\n```toml\n[dependencies]\ncsvlens = { version = \"0.12.0\", default-features = false, features = [\"clipboard\"] }\n```\n\n### Example\n\nHere's a simple example of how to use `csvlens` as a library ([Documentation](https://docs.rs/csvlens/0.12.0/csvlens/index.html)):\n\n```rust\nuse csvlens::run_csvlens;\n\nlet out = run_csvlens(\u0026[\"/path/to/your.csv\"]).unwrap();\nif let Some(selected_cell) = out {\n    println!(\"Selected: {}\", selected_cell);\n}\n```\n\nFor more advanced usage, you can use `CsvlensOptions` to customize the behavior:\n\n```rust\nuse csvlens::{run_csvlens_with_options, CsvlensOptions};\n\nlet options = CsvlensOptions {\n    filename: \"/path/to/your.csv\".to_string(),\n    delimiter: Some(\"|\".to_string()),\n    ignore_case: true,\n    debug: true,\n    ..Default::default()\n};\nlet out = run_csvlens_with_options(options).unwrap();\nif let Some(selected_cell) = out {\n    println!(\"Selected: {}\", selected_cell);\n}\n```\n\nSee how [qsv](https://github.com/dathere/qsv/tree/master?tab=readme-ov-file#qsv-blazing-fast-data-wrangling-toolkit) uses `csvlens` as a library [here](https://github.com/dathere/qsv/blob/master/src/cmd/lens.rs#L2).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYS-L%2Fcsvlens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYS-L%2Fcsvlens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYS-L%2Fcsvlens/lists"}