> For the complete documentation index, see [llms.txt](https://mmems.gitbook.io/calepin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mmems.gitbook.io/calepin/formats-encoding-and-protocols/csv.md).

# CSV

> CSV files are a little bit like like dates: superficially simple, with lots of corner cases. Largely for the same reason: not in accordance with standard.

* [RFC 4180 - Common Format and MIME Type for Comma-Separated Values (CSV) Files](https://tools.ietf.org/html/rfc4180)
* [CSV.js/csv.js at master · knrz/CSV.js](https://github.com/knrz/CSV.js/blob/master/csv.js)
* [CSV Project - Node.js CSV package](https://csv.js.org/)
* awk
  * [Awk-Batteries/Units/csv at master · Nomarian/Awk-Batteries](https://github.com/Nomarian/Awk-Batteries/tree/master/Units/csv)
  * [Awk-Batteries/csv.awk at master · Nomarian/Awk-Batteries](https://github.com/Nomarian/Awk-Batteries/blob/master/Units/csv.awk) - parse CSV `gawk -f "$AWK/Units/csv.awk" -e '{print NF}'`
  * [What's the most robust way to efficiently parse CSV using awk? - Stack Overflow](https://stackoverflow.com/questions/45420535/whats-the-most-robust-way-to-efficiently-parse-csv-using-awk)
* [How to convert arbitrary simple JSON to CSV using jq? - Stack Overflow](https://stackoverflow.com/questions/32960857/how-to-convert-arbitrary-simple-json-to-csv-using-jq)
* `sqlite3 cities.db ".mode csv" ".import ./city.csv cities" ".exit"` [Command Line Shell For SQLite](https://sqlite.org/cli.html)
* [johnkerl/miller: Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON](https://github.com/johnkerl/miller)
* [BurntSushi/xsv: A fast CSV command line toolkit written in Rust.](https://github.com/BurntSushi/xsv)
* [harelba/q: q - Run SQL directly on CSV or TSV files](https://github.com/harelba/q)
* [wireservice/csvkit: A suite of utilities for converting to and working with CSV, the king of tabular file formats.](https://github.com/wireservice/csvkit)

### Alternative formats

* [Tab-separated values - Wikipedia](https://en.wikipedia.org/wiki/Tab-separated_values)
* [Text File formats – ASCII Delimited Text – Not CSV or TAB delimited text | Ronald Duncan's Blog](https://web.archive.org/web/20201028172315/https://ronaldduncan.wordpress.com/2009/10/31/text-file-formats-ascii-delimited-text-not-csv-or-tab-delimited-text/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mmems.gitbook.io/calepin/formats-encoding-and-protocols/csv.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
