Edit CSV files with Microsoft tools

How Excel, Notepad, VS Code and Power Query handle CSV and TSV files, what each one changes in your data, and when a plain-text editor is the safer choice.

Microsoft offers several ways to open and edit comma-separated (CSV) and tab-separated (TSV) files, from Excel's spreadsheet grid to plain-text editors like Notepad and Visual Studio Code. They are not interchangeable. Some edit the file's characters exactly as stored. Others parse the text into cells, guess data types and write the data back out in a new form. This review explains what each approach actually changes, so you can decide whether the result will still mean what it meant before you opened it.

Which Microsoft tool suits your CSV task

For quick viewing, sorting, filtering or light calculation, Excel is the most convenient Microsoft option because it shows delimited data as a grid. The tradeoff is that opening a CSV directly in Excel triggers automatic interpretation of values, and saving back to CSV writes out Excel's interpretation rather than your original text. If the file will be read by another program, imported into a database or compared against a source system, that tradeoff decides most cases.

A plain-text editor such as Notepad or Visual Studio Code is preferable when exact preservation matters: identifiers with leading zeros, long account or card-style numbers, codes that resemble dates, specific date formats, or a required encoding and line-ending style. It is also the safer choice when you only need to fix a header, a delimiter or a few values. The cost is that you lose the grid view, so wide files with many columns are harder to read and edit accurately.

A middle path is to bring the file into Excel through its Text/CSV import, which uses Power Query and lets you set the delimiter, file encoding and column data types before the data lands in the sheet. This keeps the grid while giving you control over conversion. It is more steps than double-clicking the file, and it still does not guarantee a byte-identical file if you later save back to CSV.

Tool | How it treats the file | Best for | Main risk
Excel (opened directly) | Parses text into cells and converts values automatically | Viewing, sorting, filtering, quick analysis | Altered values, formats and encoding when saved back to CSV
Excel via Text/CSV import (Power Query) | Parses with user-chosen delimiter, encoding and column types | Analysis where specific columns must stay as text | More setup; saving back to CSV can still rewrite values
Notepad | Edits stored characters as plain text | Small fixes, checking raw content and encoding | No column alignment; easy to break quoting or delimiters by hand
Visual Studio Code | Edits stored characters as plain text; extensions can add column highlighting | Larger files, find and replace, version-controlled data | Behavior of third-party extensions varies and was not assessed here
Access | Imports and exports delimited text as table data | Moving CSV data into or out of a database | Import specifications define types; mismatches can drop or change values

What editing actually changes in a CSV file

A CSV or TSV file is plain text. It stores characters, a delimiter between fields, quotation marks around fields that contain delimiters or line breaks, and line endings between records. It does not store fonts, colors, column widths, formulas or data types. Anything that looks like formatting appears only while a program presents the data, and none of it survives being saved as CSV.

Plain-text editors change only the characters you type. Excel works differently: when it opens a CSV directly, it reads each field and decides whether it is a number, a date or text. What you see in a cell is then a presentation of that interpreted value, and when you save as CSV, Excel writes values based on how they are displayed, not on the original text. That distinction between stored characters and displayed values is the core reason the two approaches can produce different files from the same edit.

Commonly documented conversions when Excel opens a CSV directly include:

  • Leading zeros removed from values that look numeric, such as postal codes or product IDs.
  • Long digit strings shown in scientific notation and stored with reduced precision.
  • Text that resembles a date, such as certain codes or gene symbols, turned into a date value.
  • Dates rewritten in the format set by the computer's regional settings when the file is saved.
  • Only the active worksheet saved when a workbook is saved as CSV; other sheets, formulas and formatting are not kept.

Recent Microsoft 365 versions of Excel include settings for automatic data conversion that let you turn off some of these behaviors, such as removing leading zeros or converting values to scientific notation. Availability depends on your Excel version and channel; the specific build in which each option appears was not part of the supplied evidence.

The illustrative example below shows the kind of change that can occur when a small file is opened directly in Excel and saved back as CSV on a computer using US regional settings. It is a description of documented behavior, not the output of a recorded test.

Original file:
id,zip,joined
0042,02139,2024-03-05

Possible result after open and save in Excel:
id,zip,joined
42,2139,3/5/2024

All three fields still look plausible, which is why the change is easy to miss. The ID and ZIP code have lost their leading zeros, and the date has moved from an ISO-style format to a regional one that another system may parse differently or reject.

Two terms cause confusion here. Changing the font or cell styling in Excel is purely visual and is discarded on saving as CSV. Encoding, by contrast, changes the stored bytes: Excel's Save As list offers both a plain CSV option, which uses the system's legacy code page, and a CSV UTF-8 option. Choosing the wrong one can turn accented letters, non-Latin scripts or symbols into question marks or garbled characters in the saved file.

Separators, regions and TSV files

Excel relies on the operating system's list separator when it opens and saves CSV files. In regions where the comma is used as a decimal mark, that separator is often a semicolon, so a comma-delimited file may open as a single column, and a file saved there may use semicolons instead of commas. The Text/CSV import avoids this by letting you choose the delimiter explicitly. TSV files sidestep the comma problem because tabs rarely appear inside values, but the same data-type conversions still apply when Excel parses them.

Will the file still work after you share it

Because CSV is plain text, copying it between programs or attaching it to a message does not by itself alter the content. Problems arise when the receiving program parses the file differently from the one that created it, for example by assuming a different encoding, delimiter or date order. A file that looks correct in one installation of Excel is not proof that it will read correctly in another program, another region or another version.

Copying cells from Excel and pasting into another application typically transfers tab-separated text plus richer clipboard formats. A plain-text destination receives tab-separated values, which suits TSV but not CSV. If the destination needs commas and quoting, save or export the file instead of relying on the clipboard.

For accessibility, a CSV opened in Excel is presented as an ordinary grid, which screen readers can navigate cell by cell; the same file opened in a text editor is read as a continuous line of values and delimiters, which is harder to follow. No scoped test with a named screen reader was supplied, so this review does not make claims about how any particular assistive technology announces CSV content. Header rows with clear, unique names help in either view.

Search and editing are affected by the same stored-versus-displayed split. Searching in Excel matches what it has interpreted, so a search for an original value like 0042 may not find a cell now holding 42. Searching in a text editor matches the stored characters exactly, including quotation marks and delimiters.

Keep or share a plain-text original whenever the file feeds another system, serves as a record, or contains identifiers and dates that must remain exact. If you need Excel's features, work on a copy, import with explicit column types, save as CSV UTF-8 when non-ASCII characters are present, and compare the saved file against the original in a text editor before sending it on.

Gaps in this review

No version-specific test results, file-size measurements or performance comparisons were available, so this review does not rank the tools on speed or capacity. Behavior of third-party extensions for Visual Studio Code, Microsoft's data-handling and retention practices for cloud-based versions of Excel, and the exact menu wording in each release were also outside the supplied evidence. Check your installed version's documentation before relying on a specific setting.