> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keyflow.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Sort CSV

### **Overview:**

The `Sort CSV` block streamlines the process of arranging rows within a CSV file based on values from specified columns. This functionality eliminates the need for manual sorting, thus facilitating more effective data analysis, visualization, and reporting.

***

### Inputs & Outputs

| I/O | Feature | Type | Simple Explanation |
| - | - | - | - |
| input | `csv_file_name` | file | The name of the CSV file to be sorted. |
| input | `column_index` | number | The column index that determines which column to sort by. |
| input | `has_headers` | boolean | Indicates if the CSV file includes header rows or not. |
| input | `reverse_sort` | boolean | Specifies whether to sort in ascending or descending order. |
| output | `sorted_csv_file_name` | string | The name of the newly created sorted CSV file. |

***

### Use Cases

Consider how this block can simplify various real-world tasks:

* **Data Prioritization:** When you need to analyze employee performance metrics, sorting by a numeric value like sales figures can help identify top performers swiftly.
* **Report Preparation:** If you're generating a marketing report based on customer acquisition dates, sorting data beforehand ensures trends are easy to spot and interpret.
* **Organizing Inventory:** For inventory management, having stock items arranged by category or quantity can streamline restocking efforts.
* **Data Cleaning:** Assume you have survey response data collected from different formats; organizing it according to specific criteria aids in cleaning up inconsistencies before analysis.

In summary, any scenario requiring organized information would benefit from utilizing the `Sort CSV` block!


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.