To import a CSV file created on Linux, first copy it to a folder Windows can access, then open Excel for Microsoft 365 and choose Data > Get Data > From File > From Text/CSV. Check the delimiter, character encoding, and preview, then select Load. CSV is a plain-text format, so you do not need to convert it just because it came from Linux.
This process brings the rows and columns into an Excel worksheet. It does not carry over spreadsheet formatting, formulas as working formulas, or multiple sheets: a CSV stores tabular text only. The key is to preview the import before loading, especially if the file contains accented characters, dates, IDs with leading zeros, or commas inside values.
What You’ll Need
- A CSV file saved on Linux, with a name ending in
.csv. If you created it with an application or script, confirm that it finished writing the file before copying it. - A Windows PC with Microsoft Excel for Microsoft 365, and permission to open the folder where you put the file.
- A way to transfer the file, such as a USB drive, a shared network folder, OneDrive, or another trusted file-transfer method. If the Linux and Windows computers share a network folder, you may be able to open the CSV directly from that folder.
Step-by-Step
- Find and check the CSV on Linux. Locate the file in your file manager or in the folder where your export or script saved it. Check the filename and extension, and make sure it is a CSV rather than a compressed archive such as
.csv.gz. If the file was produced by a command-line program, check its output or file size so you do not import an incomplete or empty export. If you can, open it in a plain-text editor to confirm that it contains the expected header and a few data rows. You do not need to change its line endings merely because it was created on Linux. - Copy the file to a Windows-accessible location. Transfer it using a USB drive, a shared folder, cloud storage, or another suitable method. For example, place it in Documents or Downloads on the Windows PC, or open the shared folder from File Explorer. If using a cloud service, wait for the upload and download to finish before importing. Keep the original Linux copy unchanged until you have checked the result in Excel. If you open a file directly from a network or cloud-synced folder, make sure the connection is available and that you have permission to read it.
- Open Excel and start the text import. Open a blank workbook, or the workbook where you want the data. On the Windows ribbon, select Data > Get Data > From File > From Text/CSV. In some Microsoft 365 ribbon layouts, a From Text/CSV button appears directly on the Data tab; that opens the same type of import preview. Browse to the copied CSV, select it, and choose Import. Avoid relying on a double-click to open the file if the data contains IDs, dates, or other values Excel might automatically reinterpret.
- Review the import preview. Excel displays a sample of the file and usually identifies the delimiter and character encoding. Check that the fields appear in separate columns and that the first row is treated as headers if it contains column names. If the columns run together, use the Delimiter control to select the separator actually used in the file, such as comma, semicolon, or tab. If accented letters or other non-English characters look wrong, choose 65001: Unicode (UTF-8) in File Origin, when that option is available. Do not continue until the preview resembles the intended table.
- Choose whether to transform or load. If the preview is correct and the values can safely use Excel’s detected types, select Load to place the data in a new worksheet. If you need to preserve postal codes, product codes, long identifiers, or date-like text exactly, choose Transform Data instead. In Power Query Editor, select the relevant column and set its data type to Text before loading. For dates or decimal numbers whose interpretation depends on regional settings, check the preview and set an appropriate type and locale rather than assuming Excel has read them correctly.
- Load the data and inspect the worksheet. After loading, check the headings, row count, and a few values near the top and bottom of the imported range. Confirm that values which should be separate have not shifted into neighboring columns, and that important IDs retain their leading zeros. If you used Power Query, Excel may create a query connection as well as the worksheet table; that is normal. The loaded data is an Excel representation of the CSV, not a live link to the Linux file unless you deliberately use a refreshable query.
- Save a workbook copy in Excel format. Select File > Save As, choose a folder, and save as Excel Workbook (*.xlsx). This preserves the imported data in an Excel workbook and allows you to add formatting, formulas, or additional sheets. Keep the original CSV if you may need to re-import the unmodified text later. If you save the workbook as CSV instead, Excel will warn that CSV cannot preserve all workbook features; choose the Excel workbook format when you want to keep multiple sheets or formatting.
Common Mistakes
Opening the CSV by double-clicking it. This can be convenient for simple data, but Excel may guess data types automatically. A value such as 00157 might become 157, while a string that resembles a date may be displayed as a date. Importing through the Data tab gives you a chance to inspect the delimiter and control how sensitive columns are treated.
Assuming every CSV uses commas. CSV files can use other separators, including semicolons, particularly when they were exported under regional settings that use commas as decimal marks. A wrong delimiter can put an entire row into one column or split it incorrectly. Select the separator that matches the file’s actual contents, not just the extension.
Assuming CSV preserves the original spreadsheet. A CSV does not store cell colors, column widths, formulas as formulas, charts, or separate worksheets. It contains text values and separators. If the Linux source is a spreadsheet with formatting or multiple tabs, export the required sheet as CSV, or use a compatible workbook format if you need to retain those features.
Ignoring encoding or automatic type conversion. A file can import with garbled characters if Excel uses the wrong encoding. Automatic conversion can also alter identifiers, large numbers, or dates. Check representative values in the preview and after loading, and set sensitive columns to Text when preserving the original characters is more important than numeric calculations.
Tips
- Keep a clean source copy. Treat the Linux CSV as the original data and make any corrections in a separate copy or in the workbook. This makes it easier to repeat the import if you discover a delimiter or type setting was wrong.
- Look at the raw separators when the preview is confusing. A text editor can show whether fields are separated by commas, semicolons, or tabs. It can also reveal quotation marks around fields. Do not remove quotation marks just because they appear in the file: CSV uses them to keep commas, line breaks, or quotation marks inside a field from being mistaken for separators.
- Use Power Query for recurring imports. If you receive a replacement CSV with the same structure, the query created by the import can often be refreshed from the same file location. Keep the file path and column layout consistent, and review the refreshed result because changed headers or data types may affect the query.
- Check the file’s size and row count. Excel worksheets have a maximum of 1,048,576 rows and 16,384 columns. If the CSV exceeds the worksheet row limit, Excel cannot load every row into a single sheet. For large exports, consider filtering or splitting the data before import, or using a database or other tool suited to the file size.
- Choose a deliberate destination. For a new import, loading to a new worksheet is a straightforward way to avoid overwriting existing cells. If you load into an existing sheet, make sure the destination area is empty and that the imported table will not cover other data.
Troubleshooting
The file does not appear in the picker. Confirm that the transfer completed and that you are browsing the correct Windows folder. In the file picker, check whether a file-type filter is hiding the CSV; choose an option that shows text or all files. If the Linux file ends in .csv.gz, unzip it first and import the resulting .csv. Also check that the file has a readable name and that your Windows account can access its folder.
Everything appears in one column. Return to the import preview and select the correct delimiter. A comma-separated file should use comma, but some exports use semicolon or tab. If the data contains quoted fields with commas inside them, Excel should keep those commas within one field when the file is properly quoted. If the preview still looks wrong, inspect a few raw lines in a text editor to identify the actual separator and whether fields are consistently quoted.
Characters display as question marks or symbols. Reopen the import through the Data tab and set File Origin to UTF-8 (65001) if the source was saved as UTF-8. If that does not fix it, the CSV may have been saved in a different character encoding; identify the source application’s export encoding and choose the matching option if Excel offers it. Changing the font in Excel will not repair characters that were decoded incorrectly during import.
Leading zeros disappeared or dates changed. Re-import the original CSV rather than trying to restore values in the already altered worksheet. Choose Transform Data, set the affected column to Text, and then load it. For dates, verify the day/month order against the source. A value converted incorrectly may no longer contain enough information to determine the original text, so check the CSV or Linux source before making corrections.
Excel reports that the file is damaged or cannot be opened. Try opening the CSV in a plain-text editor on Windows. If it is empty, cut off, or contains an error message instead of rows, recreate or re-export it on Linux. If it looks intact, copy it again to a local folder and import it using Data > Get Data rather than opening it directly. For a file that is too large for a worksheet, reduce or split the export before loading.
The menu differs on Mac or Excel for the web. This guide uses Excel for Microsoft 365 on Windows. Excel for Mac has text and CSV import options in its Data tab, but ribbon labels and available Power Query features can vary by Microsoft 365 build. Excel for the web can open or upload CSV files, but its import controls may not match the Windows steps; use the desktop app when you need the Power Query type and encoding controls described above.
Frequently Asked Questions
Do I need to convert a Linux CSV before importing it into Excel?
No. CSV is a plain-text format that Excel can import regardless of whether Linux or Windows created it. You only need to transfer it to a location Excel can access and confirm the delimiter and encoding.
Can I import a CSV directly from a Linux computer?
Yes, if Excel can access the file through a shared network location or another mounted folder. Otherwise, copy it to Windows using a USB drive or trusted cloud storage first. Excel for Windows cannot browse an ordinary Linux-only local path that is not shared or mounted.
Why does Excel put the whole CSV in one column?
The delimiter selected in the import preview probably does not match the separator in the file. Change it to comma, semicolon, or tab as appropriate, then check that the preview separates the fields correctly before loading.
How do I keep leading zeros in a CSV column?
Use Transform Data during import and set that column’s data type to Text before loading. This is useful for ZIP or postal codes, account references, and product IDs that are labels rather than numbers.
Will importing the CSV update automatically when the Linux file changes?
Not by itself if you simply load a one-time copy. A Power Query import can be refreshed when the source file at its saved location is replaced or updated, provided the path and file structure remain suitable. For a copied file, update the source copy or repeat the import as needed.
Can I save the imported data back as a CSV?
Yes. Use File > Save As and choose CSV format, but remember that CSV saves only one sheet’s text data and does not retain Excel formatting, formulas as formulas, or other workbook sheets. Keep an .xlsx copy if you need those workbook features.
Related
- Excel Split Cell in Half Horizontally: Real Options
- Excel Split Cell Shortcut: The Fastest Ways to Separate Data
- Excel Split Cell After a Character: Methods That Work
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Manually Archive Emails in Microsoft OutlookTo manually archive an email in Outlook, select the message and choose Archive; Outlook moves it to the…
- How to Join Two Columns in Google Sheets With a FormulaTo join two columns in Google Sheets, enter a formula such as =A2&" "&B2 in an empty column,…
- Export Outlook Contacts to Excel: Steps and OptionsYes. You can export Outlook contacts to a comma-separated values (CSV) file and open that file in Excel;…
- Excel Paste and Remove Duplicates: Steps and SafetyTo paste data and remove duplicates in Microsoft Excel for Microsoft 365 on Windows, copy the data, select…
- How to Highlight Cells Yellow in ExcelTo highlight cells yellow in Excel for Microsoft 365 on Windows, select the cell or range, open Home…
- Where Is Flash Fill in Excel? Find It and Use ItIn Excel for Microsoft 365 on Windows, Flash Fill is on the Data tab, in the Data Tools…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.