<h1 id="xsv-for-fast-csv-manipulations---part-1-basic-usage">XSV for fast CSV manipulations - Part 1: Basic Usage</h1>
<blockquote>
<p><a href="https://github.com/BurntSushi/xsv" class="uri">https://github.com/BurntSushi/xsv</a></p>
</blockquote>
<h2 id="introduction">Introduction</h2>
<p>xsv is a command line program for indexing, slicing, analyzing, splitting and joining CSV files. Commands should be simple, fast and composable:</p>
<ol>
<li>Simple tasks should be easy.</li>
<li>Performance trade offs should be exposed in the CLI interface.</li>
<li>Composition should not come at the expense of performance.</li>
</ol>
<p>We will be using the CSV file provided in the <a href="https://burntsushi.net/stuff/worldcitiespop.csv">documentation</a>.</p>
<h2 id="commands-covered-in-this-episode">Commands covered in this episode</h2>
<ul>
<li>count - Count the rows of CSV data</li>
<li>headers - Show the headers of CSV data, or show the intersection of all headers between many CSV files</li>
<li>index - Create an index for a CSV file. This is very quick and provides constant time indexing into the CSV file.</li>
<li>frequency - Build frequency tables of each column in CSV data.</li>
<li>stats - Show basic types and statistics of each column in the CSV file. (i.e., mean, standard deviation, median, range, etc.)</li>
<li>sort - Sort CSV data</li>
<li>select - Select or re-order columns from CSV data.</li>
<li>slice - Slice rows from any part of a CSV file. 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).</li>
<li>search - Run a regex over CSV data. Applies the regex to each field individually and shows only matching rows.</li>
<li>table - Show aligned output of any CSV data using elastic tabstops.</li>
<li>flatten - A flattened view of CSV records. Useful for viewing one record at a time.</li>
</ul>
