Huge excel file to csv

Finance Mozilor 21 Reputation points
2021-03-15T09:39:18.423+00:00

Hi, I wanted to save a 100k row and 2k column excel file as csv. Unfortunately the saved csv is empty. Is there any way to get this done properly?

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,689 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erin Ding-MSFT 4,461 Reputation points
    2021-03-16T03:16:35.957+00:00

    Hi @Finance Mozilor

    Could you please tell me what version of Office you are using?

    Does this issue occur on this specific csv file or all?
    You could create a new simple csv file to check.

    If this specific csv file, how did you open it? Will it be opened successfully on another PC?
    If you double-click it to open, please try to open Excel, then go to File>Open, in Browse, choose the csv file, click the drop-down button on the right side of the Open button, and select Open and Repair to check this issue.
    78072-image.png

    If all csv file, please try the following.

    1. Press Win+R to open Run. Type regedit in it, Enter.
    2. Navigate to the following three path.
      HKEY_CLASSES_ROOT\Excel.csv\shell\Open\command
      HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open\command
      HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\Open\command
      Modify their Value data, change the value /dde at the end to be "%1".
      Note: please back up registry before modifying.

    Before:
    "C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE" /dde
    After:
    "C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE" "%1"

    Take the first path as an example.
    78042-image.png
    77944-image.png

    Besides, you could also open Excel in safe mode to eliminate interference from add-ins and startup items, then open csv file.

    • Press Win+R, type excel /safe in Run, Enter.

    If you could open csv file successfully when opening Excel in safe mode:

    • Move the files in C:\Users\<User Name>\AppData\Roaming\Microsoft\Excel\XLSTART to other location temporarily, then check if the issue still exists.
    • If still exists, please go to File>Options>Add-Ins. Towards the bottom of the window, where it says Manage, select COM Add-ins, click Go. In the dialog box, uncheck the add-ins to disable them.
      Then close and restart Excel to see if the issue is resolved.

    Any updates, please let me know.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. David 151 Reputation points
    2021-06-15T02:59:54.203+00:00

    Try Spire.XLS. You can install it into your visual studio via NuGet and then use the following code to convert Excel (xls or xlsx) to CSV format files.

    using Spire.Xls;
    
    namespace ToCSV
    {
        class Program
        {
            static void Main(string[] args)
            {
                Workbook workbook = new Workbook();
                workbook.LoadFromFile(@"..\Excel.xlsx");
                Worksheet sheet = workbook.Worksheets[0];
                sheet.SaveToFile("result.csv", ",", Encoding.UTF8);
            }
        }
    }
    
    0 comments No comments