# How to Edit a CSV File on a Mac Without Excel Changing It

ComfortFiles is a Windows Explorer-style file manager for macOS.

A CSV file is a table saved as plain text. Excel opens it, but it also changes it: leading zeros disappear, long numbers turn into `4.11E+15`, and things that look like dates become dates. In ComfortFiles you can fix a value in the preview panel, and nothing else in the file moves.

<video class="howto-shot" autoplay muted loop playsinline poster="/media/how-to/edit-csv-poster.png" width="1160" height="816">
  <source src="/media/how-to/edit-csv.mp4" type="video/mp4" />
</video>

## Change a value

1. Select the CSV file. The preview panel (<kbd>⇧⌘P</kbd>) shows it as a table, with the columns named A, B, C as in a spreadsheet.
2. Click a cell and type the new value. Press <kbd>Return</kbd>.
3. **Save** and **Revert** appear under the table as soon as something changed. Click **Save**, or press <kbd>⌘S</kbd>.

Changed your mind? **Revert** forgets every change since the last save. <kbd>⌘Z</kbd> undoes the last change in the table, one step at a time.

To select whole rows rather than type in them, click their numbers on the left (<kbd>⇧</kbd> or <kbd>⌘</kbd> to select several).

## Find and sort rows

- **Search:** type in the field above the table. Only the rows with a match in any column stay, and the count beside the field says how many, for example *12 of 340*. Upper and lower case and accents do not matter. Press <kbd>Esc</kbd> to see every row again.
- **Sort:** click a column’s header, and click it again to reverse. Numbers sort as numbers, so 9 comes before 10. Click the header above the row numbers to go back to the order of the file.

The file's first row stays on top whatever you search for or sort by, since it usually names the columns. Searching and sorting change only what you see: the file keeps its own order, and a value you change is saved in its own row.

The panel can be made wider by dragging its left edge, and the table scrolls sideways when it has more columns than fit.

## Add or delete rows and columns

The **+** under the table adds a row above or below the selected one, or a column to the left or right of the one you last clicked. The **−** deletes the selected rows or that column. The same is on the menu when you right-click the table.

## What stays exactly as it was

- **Your values.** `007` stays `007`, a card or account number stays all its digits, and `03/04` stays text. Nothing is turned into a number or a date.
- **Everything you did not touch.** The file keeps its delimiter (commas, semicolons as Excel writes in much of Europe, or tabs), its quotes, its line endings (including Windows ones) and its encoding: UTF-8 with or without a BOM, UTF-16, Windows Cyrillic and Western, and Shift JIS from Japanese Excel. A file read and saved without a change is byte for byte the same file.
- **The file itself.** Saving writes the new file beside the old one and then swaps them, so a crash halfway leaves the old file whole. Its tags, permissions and creation date stay.

## When a file can only be looked at

A short line under the table says why the cells cannot be changed:

- **The file is too large to change here** — over 10 MB or 100,000 rows. It is still shown as a table. Files over 20 MB are shown by macOS's own preview.
- **A quoted value is never closed**, or there is text after a closing quote. The file is not valid CSV, and saving it would mean guessing what was meant.
- **You don't have permission to change this file.**

If you type something the file's encoding cannot hold, such as an emoji in a Windows Cyrillic file, ComfortFiles says so instead of saving a broken file.

## Leaving with unsaved changes

If you select another file, close the window or quit with changes not yet saved, ComfortFiles asks whether to save them first. **Keep Editing** leaves you in the table.

The same is in the preview panel's menu while a table is on screen: right-click the panel and choose **How editing CSV files works**.

## Frequently asked questions

### How do I edit a CSV file on a Mac without Excel?

Select the file in ComfortFiles. The preview panel (<kbd>⇧⌘P</kbd>) shows it as a table. Click a cell, type the new value and press <kbd>Return</kbd>. Then click <strong>Save</strong> or press <kbd>⌘S</kbd>.

### Why does Excel remove the leading zeros from my CSV file?

Excel guesses what each value is. <code>007</code> looks like a number, so it becomes <code>7</code>; a 16-digit ID turns into <code>4.11E+15</code>; <code>03/04</code> becomes a date. When Excel saves, the guess is written into the file. ComfortFiles guesses nothing: every value stays the text it was.

### Will saving change the rest of my file?

No. Only the cells you changed are written differently. The file keeps its commas or semicolons or tabs, its quotes, its line endings and its encoding, including the Windows Cyrillic, Western and Japanese ones Excel still writes.

### Does sorting the table change my file?

No. Clicking a column’s header sorts what you see, and the search only hides rows from view. The file keeps its own order, and a value you change is saved in its own row.

### Why can I not change the cells of my CSV file?

A short line under the table says why. A file larger than 10 MB or 100,000 rows can be looked at but not changed here. So can a file that does not read cleanly, for example one with a quote that is never closed, and a file you have no permission to change.

### What if another app changes the file while I am editing it?

A line under the table says so, with <strong>Reload</strong> to see the file as it is now and <strong>Keep Editing</strong> to go on. If you then save, ComfortFiles asks first, because saving replaces the other app’s changes with yours.
