Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7670647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:52:13+00:00 2026-05-31T15:52:13+00:00

I was looking at the solution suggested here: C# Excel Interop: Opening and Showing

  • 0

I was looking at the solution suggested here:
C# Excel Interop: Opening and Showing CSV file

excel.Workbooks.OpenText(filename, 
                         DataType: Excel.XlTextParsingType.xlDelimited, 
                         TextQualifier: Excel.XlTextQualifier.xlTextQualifierNone,
                         ConsecutiveDelimiter: true,
                         Semicolon: true);

This code opens the CSV file but does not split the data on the semicolon.

If I open the file manually in Excel and use the same options as specified here it works just fine, so I must be missing something.

Any suggestions?

Update: Part of the CSV

> Betalings Enveloppe;;;;Dossier;ACME ;;;;Dagboek;;F4 - AAA
> 46846846-;;; ;;;;Rekening;54654684684684;;;;BIC;;null;;; ;;;;Betaal
> datum;Fri Mar 16 00:00:00 CET 2012;;;;EnveloppeId;;0002;;;
> Document;;Datum;Rekeningnummer;;;;BIC;Referentie;;Leverancier;;;Bedrag;
> 2012/A1/268;;29/02/2012;BE94684684684128;;;;BBRUBEBB;BLUB ;;DOKTER WHO
> ;;;28.0 ?;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:52:14+00:00Added an answer on May 31, 2026 at 3:52 pm

    I think the extension is your problem. I tried the following code with both CSV and TXT extensions, it worked as a TXT, but not as a CSV.

    using Excel = Microsoft.Office.Interop.Excel;
    using Word = Microsoft.Office.Interop.Word;
    public class ExcelInteropTest
    {
        //private static Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
        public static void Parse(String filename)
        {
            var _app = new Excel.Application();
            var _workbooks = _app.Workbooks;
    
            _workbooks.OpenText(filename,
                                     DataType: Excel.XlTextParsingType.xlDelimited,
                                     TextQualifier: Excel.XlTextQualifier.xlTextQualifierNone,
                                     ConsecutiveDelimiter: true,
                                     Semicolon: true);
    
            Excel.Sheets sheets = _workbooks[1].Worksheets;
            Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
    
            List<String[]> excelData = new List<string[]>();
            for (int i = 1; i <= 6; i++)
            {
                Excel.Range range = worksheet.get_Range("A" + i.ToString(), "Z" + i.ToString());
                System.Array myvalues = (System.Array)range.Cells.Value;
                string[] strArray = myvalues.OfType<object>().Select(o => o.ToString()).ToArray();
                excelData.Add(strArray);
            }
    
            foreach (var item in excelData)
            {
                Console.WriteLine(String.Join("|",item));
            }
    
        }
    
    }
    

    All I did was create a string array for each row and add it to a list, then I just wrote each array (joined on the pipe ‘|’, and it looks like it split everything correctly when TXT was the extension. I would guess that the special nature CSV files have in excel might be causing the problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for solution to extract some node from large xml file (using xmlstarlet
Based on the discussion here , I am looking for an easy-to-implement solution for
In regard to my question here , Jacob Relkin suggested a great solution of
I'm looking for the best solution here, i've got an idea but thinking it
I'm looking for solution to get time to click on element using implicitlyWait in
I'm looking for solution for a in memory script cache, using Zend_Cache and zend
Looking for a solution in bash (will be part of a larger script). Given
I was looking for a solution for client side printing of reports and pre
I'm looking for a solution for capturing audio from a user's microphone and posting
I'm looking for a solution to convert a set of files using the terminal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.