# CSV

---

EmEditor makes it convenient for you to edit different delimited formats, especially **comma-separated values (CSV)** files. When open a CSV file, all the separators line up vertically. You can quickly edit the document using the **CSV/Sort** toolbar, which includes commands like **Sort by Multiple Columns**, **Extract Columns**, **Line Number**, **Ruler**, and **Heading**. Furthermore, the versions after EmEditor v14.6 has enhanced the CSV features and give you more options to customize any CSV document:

- You can define up to **64** CSV formats, and each format now allows up to **39**-character long text.
- You can easily filter any CSV file through the **Filter toolbar**. The **Advanced Filter** dialogue box allows you to specify filter strings and conditions for each column. Furthermore, you can simply click the **Negative** button on the Filter toolbar to exclude the matched lines.
- The [**Join CSV**](/text-editor-features/more-features/join-csv/) feature allows you to **merge two CSV documents** specifying key columns, using a method analogous to SQL JOIN operations (INNER JOIN, OUTER JOIN, RIGHT JOIN and LEFT JOIN).
- Have embedded newlines in your CSV document? No problem! You can select the [**Remove Embedded Newlines** ](/faq/csv-faq/how-do-you-remove-embedded-newlines-in-a-csv-document/)command on the **CSV/Sort toolbar** to quickly remove the embedded newlines. You can also use the new **Match Only Embedded Newlines in CSV** option in the **Find dialog box** as well as the **Find toolbar** to find, replace, and remove newlines.
- Want to mark all the duplicate lines in your file? The [**Delete Duplicate Lines**](/text-editor-features/more-features/delete-duplicate-lines/) dialog box can help you set bookmarks for duplicate lines without deleting them. You can also apply the command to all documents in a group.
- EmEditor v17.2 added the **AutoFill** feature in the CSV cell selection mode. The AutoFill feature allows you to drag the bottom right corner of the selected cell border (**AutoFill handle**) to copy the same value as the selected cell to the up, down, right, or left neighboring cell(s). If multiple cells are selected and those cells contain values including serial numbers, those values can be easily extended by dragging the AutoFill handle. Double-clicking the AutoFill handle while the selected cell is at the top of the CSV document, the above behavior can be applied to the entire column of the document.
- Added the **Flash Fill** command. Selecting the **Flash Fill** command while in the CSV cell selection mode causes EmEditor to compare the current cell with other columns, and fills the current column with data if it finds an apparent pattern.
- EmEditor v21.4 added a set of new data-analysis commands—**Transpose**, [**Pivot Table**](/text-editor-features/more-features/pivot-table/), and **Unpivot**—used for CSV documents. The **Transpose** command simply switches the rows and columns of a CSV document. The **Pivot Table** finds all distinct values for a specified column, and for each distinct value, the command counts the occurrences or calculates the total values in another specified column. The **Unpivot** command is the reverse of the **Pivot Table** command. They are simple enough to use even if users aren’t familiar with them. For instance, Each option of the **Pivot Table** dialog box is placed visually as the actual location of a pivot table. These commands can be recorded to a macro, which you can reuse later for repeated use. They are optimized for speed, and allow you to analyze big data more quickly while you deal with CSV files. The **Sort** toolbar includes these buttons for **Transpose**, **Pivot Table** and **Unpivot** commands.

<YouTube video="RwcBGG7TuA4" title="How to convert CSV formats, CSV to Fixed-width text, and Fixed-width text to CSV" />

<YouTube video="PUiRUFxKVyo" title="EmEditor - AutoFill and Flash Fill on CSV" />

```gallery
images:
- src: /media/2014/10/CSV_heading.webp
  caption: File in CSV mode with the first line as Heading
- src: /media/2014/10/Costomize_CSV1.webp
  caption: Customize CSV dialog box
- src: /media/2013/09/sort_by_multiple_new.webp
  caption: Sort by Multiple Columns dialog box.
- src: /media/2015/03/extract_all.webp
  caption: Extract All button was added to the Filter Toolbar.
- src: /media/2015/03/advanced_filter.webp
  caption: The new Advanced Filter Settings.
- src: /media/2015/01/Join_CSV.webp
  caption: Join CSV dialog box.
- src: /media/2015/02/remove_embedded_nl.webp
  caption: The Remove Embedded Newlines in CSV command was added.
- src: /media/2015/02/delete_bookmark_duplicate_advanced.webp
  caption: Bookmark or delete duplicate lines.
- src: /media/2017/10/auto_fill_handle.webp
  caption: EmEditor v17.2 allows you to extend values including serial numbers by dragging the AutoFill handle.
- src: /media/2017/10/flash_fill_after.webp
  caption: With the new Flash Fill button, EmEditor can compare the current cell with other columns and fill the current column with values based on the selected cell(s).
- src: /media/2021/12/transpose_pivot_unpivot_buttons.webp
  caption: Added the “Transpose”, “Pivot Table” and “Unpivot” buttons to the “Sort” toolbar.
- src: /media/2021/12/pivot_table_settings.webp
  caption: Create a pivot table in the CSV document.
- src: /media/2021/12/pivot_table_result.webp
  caption: Create a pivot table in the CSV document.
- src: /media/2021/12/unpivot_settings.webp
  caption: Convert columns into rows by flattening the CSV data.
- src: /media/2021/12/unpivot_result.webp
  caption: Convert columns into rows by flattening the CSV data.
```
