Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open the folder containing your CSV in VS Code, then select the file in Explorer. A single click opens it in a temporary preview tab; double-click the file to keep it in a dedicated tab. For a table-oriented view, right-click the CSV and choose Open in Data Wrangler.

Open a CSV file in VS Code

  1. Open the file’s folder. In VS Code, use File > Open Folder and select the folder containing the CSV. You can also open the current folder from a terminal with code ., or open a file by passing its path to the code command. Paths can be absolute or relative to the terminal’s current directory. See Microsoft’s VS Code CLI guide for command-line details.
  2. Find the CSV in Explorer. Select the Explorer icon in the Activity Bar if the file list is not visible, then locate the CSV in the folder tree.
  3. Click the file to preview it. VS Code opens the CSV in the editor. This is a text-file view of its contents, not a spreadsheet-style table. Microsoft’s user interface guide explains how editor preview tabs work.

Keep the CSV open in its own tab

A single click opens a file in preview mode. The tab title appears in italics, and selecting another file reuses that preview tab—so the CSV may seem to disappear even though it has not been closed.

  • Keep one file open: Double-click its name in Explorer to open it in a dedicated tab.
  • Keep a file after editing: Editing a preview file also makes it a regular editor tab.
  • Change preview behavior: The settings workbench.editor.enablePreview and workbench.editor.enablePreviewFromQuickOpen control preview behavior. You can search for these settings in VS Code’s Settings UI.

Open a CSV in a data-oriented view

If you want to work with rows and columns rather than inspect comma-separated text, right-click the local CSV in Explorer and select Open in Data Wrangler. Microsoft documents CSV and TSV as directly supported file types in its Data Wrangler guide. Available delimiter or sheet choices depend on the file type. This route is distinct from opening the CSV in the regular text editor.

Choose the right way to view the file

What you need Use What to expect
Quickly inspect the file’s contents Single-click the CSV in Explorer Opens as text in a preview tab, which VS Code can reuse.
Keep the CSV in a separate editor tab Double-click the file or edit it Opens or converts it to a dedicated tab.
Work with CSV rows and columns in a data-focused interface Right-click the CSV and choose Open in Data Wrangler Uses Data Wrangler’s documented data-viewing workflow for supported local files.
Open from a terminal Run code path/to/file.csv or code . The first command opens the specified file; code . opens the current folder.

Install a CSV extension only if you need one

If Data Wrangler or the text editor does not meet your needs, look for an extension in VS Code’s Extensions view and inspect its Marketplace listing. Check the publisher, description, README, feature contributions, changelog, and dependencies before installing. Microsoft notes that extensions have the same permissions as VS Code itself. Starting with VS Code 1.97, VS Code prompts for publisher trust the first time you install an extension from a third-party publisher. See Microsoft’s Extension Marketplace documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

If the code command is not available

On macOS, the VS Code CLI guide says you may need to add the code command to your PATH. In VS Code, open the Command Palette and run Shell Command: Install ‘code’ command, then try the command again in a terminal.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.