qsv Command Help
June 24, 2026 ยท View on GitHub
Auto-generated from qsv command USAGE text. See README for full documentation.
| Command | Description |
|---|---|
| apply ๐๐ง ๐ค๐๐ฃ๐โฉ๏ธ | Apply series of string, date, math & currency transformations to given CSV column/s. It also has some basic NLP functions (similarity, sentiment analysis, profanity, eudex, language & name gender) detection. Its summarize subcommand condenses a column or group of columns using an OpenAI API-compatible LLM (local or commercial) with customizable, Mini Jinja-templated per-record prompts. |
| applydp ๐๐๐ฃ๐ ![]() | applydp is a slimmed-down version of apply with only Datapusher+ relevant subcommands/operations (qsvdp binary variant only). |
| behead | Drop headers from a CSV. |
| blake3 ๐ | Compute or check BLAKE3 hashes of files. |
| cat ๐๏ธ | Concatenate CSV files by row or by column. |
| clean | Remove qsv-generated cache files (.idx index, stats & frequency caches) to reduce clutter & simplify data packaging. With --stale, only removes caches whose source changed or is gone. Opt-in flags also clean schema, validate & moarstats outputs. |
| clipboard ๐ฅ๏ธ | Provide input from the clipboard or save output to the clipboard. |
| color ๐คฏ๐ปโโ๏ธ๐ฅ๏ธ | Outputs tabular data as a pretty, colorized table that always fits into the terminal. Apart from CSV and its dialects, Arrow, Avro/IPC, Parquet, JSON array & JSONL formats are supported with the "polars" feature. |
| count ๐๐ปโโ๏ธ๐๏ธ | Count the rows and optionally compile record width statistics of a CSV file. (11.87 seconds for a 15gb, 28m row NYC 311 dataset without an index. Instantaneous with an index.) If the polars feature is enabled, uses Polars' multithreaded, mem-mapped CSV reader for fast counts even without an index |
| datefmt ๐๐๐ | Formats recognized date fields (19 formats recognized) to a specified date format using strftime date format specifiers. |
| dedup ๐คฏ๐๐ | Remove duplicate rows (See also extdedup, extsort, sort & sortcheck commands). |
| describegpt ๐๐๏ธ๐ค๐๐ช๐โฉ๏ธ ![]() | Infer a "neuro-symbolic" Data Dictionary, Description & Tags or ask questions about a CSV with a configurable, Mini Jinja prompt file, using any OpenAI API-compatible LLM, including local LLMs. (e.g. Markdown, JSON, TOON, JSON Schema, Semantic Markdown, OKF, Everything, Spanish, Mandarin, Controlled Tags; --prompt "What are the top 10 complaint types by community board & borough by year?" - deterministic, hallucination-free SQL RAG result; iterative, session-based SQL RAG refinement - refined SQL RAG result) |
| diff ๐ | Find the difference between two CSVs with ludicrous speed! e.g. compare two CSVs with 1M rows x 9 columns in under 600ms! |
| edit | Replace the value of a cell specified by its row and column. |
| enum ๐ | Add a new column enumerating rows by adding a column of incremental or uuid identifiers. Can also be used to copy a column or fill a new column with a constant value. |
| excel ๐ | Exports a specified Excel/ODS sheet to a CSV file. |
| exclude ๐๐ | Removes a set of CSV data from another set based on the specified columns. |
| explode ๐ฃ๐ | Explode rows into multiple ones by splitting a column value based on the given separator. The inverse of implode. |
| extdedup ๐ | Remove duplicate rows from an arbitrarily large CSV/text file using a memory-mapped, on-disk hash table. Unlike the dedup command, this command does not load the entire file into memory nor does it sort the deduped file. |
| extsort ๐๐๐ | Sort an arbitrarily large CSV/text file using a multithreaded external merge sort algorithm. |
| fetch ๐๐ง ๐ | Send/Fetch data to/from web services for every row using HTTP Get. Comes with HTTP/2 adaptive flow control, jaq JSON query language support, dynamic throttling (RateLimit) & caching with available persistent caching using Redis or a disk-cache. |
| fetchpost ๐๐ง ๐โฉ๏ธ | Similar to fetch, but uses HTTP Post (HTTP GET vs POST methods). Supports HTML form (application/x-www-form-urlencoded), JSON (application/json) and custom content types - with the ability to render payloads using CSV data using the Mini Jinja template engine. |
| fill ๐ | Fill empty values. |
| fixlengths | Force a CSV to have same-length records by either padding or truncating them. |
| flatten | A flattened view of CSV records. Useful for viewing one record at a time. e.g. qsv slice -i 5 data.csv | qsv flatten. |
| fmt | Reformat a CSV with different delimiters, record terminators or quoting rules. (Supports ASCII delimited data.) |
| foreach | Execute a shell command once per record in a given CSV file. |
| frequency ๐๐ฃ๐๏ธ๐๐ช ![]() | Build frequency distribution tables of each column. Uses multithreading to go faster if an index is present (Examples: CSV JSON TOON). |
| get ๐๐ง ๐ ![]() | Get tabular data from local files, URLs (http/https & dathere://) & CKAN (ckan://) into a managed, queryable disk cache - with conditional revalidation (ETag/Last-Modified), transparent zstd compression, BLAKE3 hashing & automatic indexing. Cached resources are reusable by ANY qsv command via the dc: prefix (e.g. qsv stats dc:data.csv), with stale entries auto-refreshed. Efficiently seeds luau lookup tables, validate dynamicEnum reference data & speeds up Datapusher+ harvesting. |
| geocode ๐๐ง ๐๐๐ฃ๐๐ | Geocodes a location against an updatable local copy of the Geonames cities & the Maxmind GeoLite2 databases โ with caching and multi-threading, this offline path geocodes up to 360,000 records/sec! Can also geocode online (forward & reverse) via the OpenCage geocoder. |
| geoconvert ๐ | Convert between various spatial formats and CSV/SVG including GeoJSON, SHP, and more. |
| headers ๐๏ธ | Show the headers of a CSV. Or show the intersection of all headers between many CSV files. |
| implode ๐ฃ๐ | Implode rows by grouping on key column(s) and joining a value column with a given separator. The inverse of explode. |
| index | Create an index for a CSV. This is very quick (even the 15gb, 28m row NYC 311 dataset takes all of 14 seconds to index) & provides constant time indexing/random access into the CSV. With an index, count, sample & slice work instantaneously; random access mode is enabled in luau; and multithreading is enabled for the frequency, split, stats & schema commands. |
| input | Read CSV data with special commenting, quoting, trimming, line-skipping & non-UTF8 encoding handling rules. Typically used to "normalize" a CSV for further processing with other qsv commands. |
| join ๐๐ฃ๐ | Inner, outer, right, cross, anti & semi joins. Automatically creates a simple, in-memory hash index to make it fast. |
| joinp ๐ปโโ๏ธ๐๐ช | Inner, outer, right, cross, anti, semi, non-equi & asof joins using the Pola.rs engine. Unlike the join command, joinp can process files larger than RAM, is multithreaded, has join key validation, a maintain row order option, pre and post-join filtering, join keys unicode normalization, supports "special" non-equi joins and asof joins (which is particularly useful for time series data) & its output columns can be coalesced. |
| json ๐ | Convert JSON array to CSV. |
| jsonl ๐๐ฃ | Convert newline-delimited JSON (JSONL/NDJSON) to CSV. See tojsonl command to convert CSV to JSONL. |
| lens ๐๏ธ๐ปโโ๏ธ๐ฅ๏ธ | Interactively view, search & filter tabular data files using the csvlens engine. Apart from CSV and its dialects, Arrow, Avro/IPC, Parquet, JSON array & JSONL formats are supported with the "polars" feature. |
| luau ๐๐๐ฃ๐ ![]() | Create multiple new computed columns, filter rows, compute aggregations and build complex data pipelines by executing a Luau 0.725 expression/script for every row of a CSV file (sequential mode), or using random access with an index (random access mode). Can process a single Luau expression or full-fledged data-wrangling scripts using lookup tables with discrete BEGIN, MAIN and END sections. It is not just another qsv command, it is qsv's Domain-specific Language (DSL) with numerous qsv-specific helper functions to build production data pipelines. |
| moarstats ๐๐๏ธ | Add up to an additional 55 statistical measures, including extended outlier, robust & bivariate statistics to an existing stats CSV file. (example). |
| partition ๐ | Partition a CSV based on a column value. |
| pivotp ๐ปโโ๏ธ๐๐ช | Pivot CSV data. Features "smart" aggregation auto-selection based on data type & stats. |
| pragmastat ๐๐คฏ๐ฒ๐ช | Compute pragmatic statistics using the Pragmastat library. Uses the stats cache to auto-filter non-numeric columns and support Date/DateTime columns. |
| pro | Interact with the qsv pro API. |
| profile ๐๐ง ๐ค๐โฉ๏ธ ![]() | Extract, derive & infer metadata from a CSV (local path or URL) - using the statistical profile of a dataset, mapped and driven by a configurable metadata scheming YAML spec (DCAT-US v3, DCAT-AP v3 and Croissant 1.1 bundled; Geoconnex when built with the geoconnex feature), with optional CKAN/DCAT metadata discovery for URL inputs. This enables FAIRification at scale. |
| prompt ๐ปโโ๏ธ๐ฅ๏ธ | Open a file dialog to either pick a file as input or save output to a file. |
| pseudo ๐ฃ๐ | Pseudonymise the value of the given column by replacing them with an incremental identifier. |
| py ๐๐ฃ | Create a new computed column or filter rows by evaluating a Python expression on every row of a CSV file. Python's f-strings is particularly useful for extended formatting, with the ability to evaluate Python expressions as well. Requires Python 3.11 or greater. |
| rename | Rename the columns of a CSV efficiently. |
| replace ๐๐๏ธ๐ | Replace CSV data using a regex. Applies the regex to each field individually. |
| reverse ๐๐คฏ | Reverse order of rows in a CSV. Unlike the sort --reverse command, it preserves the order of rows with the same key. If an index is present, it works with constant memory. Otherwise, it will load all the data into memory. |
safenames![]() | Modify headers of a CSV to only have "safe" names - guaranteed "database-ready"/"CKAN-ready" names. |
| sample ๐๐๏ธ๐๐ฒ๐ช | Randomly draw rows (with optional seed) from a CSV using ten different sampling methods - reservoir (default), indexed, bernoulli, systematic, stratified, weighted, varopt, mergeable-reservoir, cluster & timeseries sampling. The --varopt & --mergeable-reservoir modes support mergeable sketch I/O (--sketch-out/--sketch-in) so sharded inputs can be sampled and combined without re-reading the corpus. Supports sampling from CSVs on remote URLs. Uses the stats cache to skip unnecessary scanning and inform its sampling strategies. |
| schema ๐๐ฃ๐ปโโ๏ธ๐๏ธ๐๐ช | Infer either a JSON Schema Validation Draft 2020-12 (Example) or Polars Schema (Example) from CSV data. In JSON Schema Validation mode, it produces a .schema.json file replete with inferred data type & domain/range validation rules derived from stats. Uses multithreading to go faster if an index is present. See validate command to use the generated JSON Schema to validate if similar CSVs comply with the schema. With the --polars option, it produces a .pschema.json file that all polars commands (sqlp, joinp & pivotp) use to determine the data type of each column & to optimize performance. Both schemas are editable and can be fine-tuned. For JSON Schema, to refine the inferred validation rules. For Polars Schema, to change the inferred Polars data types. |
| scoresql ๐ปโโ๏ธ๐ช | Analyze a SQL query against CSV file caches (stats, moarstats, frequency) to produce a performance score with actionable optimization suggestions BEFORE running the query. Supports Polars (default) and DuckDB modes. |
| search ๐๐๏ธ๐ | Run a regex over a CSV. Applies the regex to selected fields & shows only matching rows. |
| searchset ๐๐๏ธ๐ | Run multiple regexes over a CSV in a single pass. Applies the regexes to each field individually & shows only matching rows. |
| select ๐ | Select, re-order, reverse, duplicate or drop columns. |
| slice ๐๐๏ธ๐๏ธ | Slice rows from any part of a CSV. When an index is present, this only has to parse the rows in the slice (instead of all rows leading up to the start of the slice). |
| snappy ๐๐ | Does streaming compression/decompression of the input using Google's Snappy framing format (more info). |
| sniff ๐๐ค๐ ![]() | Quickly sniff & infer CSV metadata (delimiter, header row, preamble rows, quote character, flexible, is_utf8, average record length, number of records, content length & estimated number of records if sniffing a CSV on a URL, number of fields, field names & data types). It is also a general mime type detector. |
| sort ๐คฏ๐๐๐ฒ | Sorts CSV data in lexicographical, natural, numerical, reverse, unique or random (with optional seed) order (Also see extsort & sortcheck commands). |
| sortcheck ๐ | Check if a CSV is sorted. With the --json options, also retrieve record count, sort breaks & duplicate count. |
| split ๐๐๏ธ | Split one CSV file into many CSV files. It can split by number of rows, number of chunks or file size. Uses multithreading to go faster if an index is present when splitting by rows or chunks. |
| sqlp ๐๐๏ธ๐ปโโ๏ธ๐๐ช | Run Polars SQL (a PostgreSQL dialect) queries against several CSVs, Parquet, JSONL and Arrow files - converting queries to blazing-fast Polars LazyFrame expressions, processing larger than memory CSV files. Query results can be saved in CSV, JSON, JSONL, Parquet, Apache Arrow IPC and Apache Avro formats. |
| stats ๐๐คฏ๐๏ธ๐๐ช | Compute up to 48 summary statistics & make GUARANTEED data type inferences (Null, String, Float, Integer, Date, DateTime, Boolean) for each column in a CSV (Example). Uses multithreading to go faster if an index is present. With an index, can compile "streaming" stats on a 1M row sample of NYC's 311 data in less than 0.25 seconds vs 2.24 seconds without one. |
| synthesize ๐๐ฒ๐ค | Generate a synthetic CSV that is statistically faithful to a source CSV. Runs stats + frequency on the source so synthesized columns reproduce its per-column attributes โ frequency-weighted sampling for categorical columns, quartile-bucketed numeric/date generation, null-ratio preservation. With a Data Dictionary from describegpt --dictionary --infer-content-type, semantic Content Types pick realistic fake-rs fakers (names, emails, addresses, UUIDs, etc.) for non-enumerable columns. A dictionary relationships array preserves inter-column structure within each row โ joint (functional dependencies like city/state/zip), ordered (monotonic chains like created_date โค closed_date) and correlated (numeric correlation via a Gaussian copula). Fully reproducible with --seed. |
| table ๐คฏ | Align output of a CSV using elastic tabstops for viewing; or to create an "aligned TSV" file or Fixed Width Format file. To interactively view a CSV, use the lens command. |
| template ๐๐๐ฃ๐โฉ๏ธ ![]() | Renders a template using CSV data with the Mini Jinja template engine (Example). |
| to ๐๏ธ๐ปโโ๏ธ๐ | Convert CSV files to Parquet, PostgreSQL, SQLite, Excel (XLSX), LibreOffice Calc (ODS) and Data Package. |
| tojsonl ๐๐ฃ๐๏ธ๐๐ฃ๐ช | Smartly converts CSV to a newline-delimited JSON (JSONL/NDJSON). By scanning the CSV first, it "smartly" infers the appropriate JSON data type for each column. See jsonl command to convert JSONL to CSV. |
| transpose ๐คฏ๐ | Transpose rows/columns of a CSV. |
| validate ๐๐๏ธ๐๐๐ ![]() | Validate CSV data blazingly-fast using JSON Schema Validation (Draft 2020-12) (e.g. up to 780,031 rows/second[^1] using NYC's 311 schema generated by the schema command) & put invalid records into a separate file along with a detailed validation error report. Supports several custom JSON Schema formats & keywords: * currency custom format with ISO-4217 validation * dynamicEnum custom keyword that supports enum validation against a CSV on the filesystem or a URL (http/https/ckan & dathere URL schemes supported) * uniqueCombinedWith custom keyword to validate uniqueness across multiple columns for composite key validation. If no JSON schema file is provided, validates if a CSV conforms to the RFC 4180 standard and is UTF-8 encoded. |
| viz ๐ช๐ | Generate interactive charts (bar, line, scatter, histogram, box, pie, heatmap, candlestick/ohlc, sankey, radar, geographic maps) and an auto-dashboard (viz smart) from CSV data using plotly. viz smart "automagically" picks an appropriate chart per column from the dataset's statistics & frequency distributions (box plots for continuous columns from precomputed quartiles; frequency bars for low-cardinality/boolean columns; a correlation heatmap when there are 2+ eligible continuous numeric columns; a map panel when a lat/lon column pair is detected). Outputs self-contained, interactive HTML (charts work offline; map basemaps fetch their tiles over the network unless the white-bg style is used) - or static PNG/SVG/PDF/JPEG/WebP with the viz_static feature - and can --open the result in your browser. |
Legend
โจ: enabled by a feature flag.
๐: uses an index when available.
๐คฏ: loads entire CSV into memory, though dedup, stats & transpose have "streaming" modes as well.
๐ฃ: uses additional memory proportional to the cardinality of the columns in the CSV.
๐ง : expensive operations are memoized with available inter-session Redis/Disk caching for fetch commands.
๐๏ธ: Extended input support.
๐๏ธ: Limited Extended input support.
๐ปโโ๏ธ: command powered/accelerated by vectorized query engine.
๐ค: command uses Natural Language Processing or Generative AI.
๐๏ธ: multithreaded and/or faster when an index (๐) is available.
๐: multithreaded even without an index.
: has CKAN-aware integration options.
๐: has web-aware options.
๐ฃ: requires UTF-8 encoded input.
๐: has powerful column selector support. See select for syntax.
๐ช: "automagical" commands that uses stats and/or frequency tables to work "smarter" & "faster".
๐: has lookup table support, enabling runtime "lookups" against local or remote reference CSVs.
๐: has geospatial capabilities.
โฉ๏ธ: uses Mini Jinja template engine.
: uses Luau 0.725 as an embedded scripting DSL.
๐ฒ: randomly generated or randomized output with a --seed option for reproducibility.
๐ฅ๏ธ: part of the User Interface (UI) feature group.