CSV file reader when some fields are quoted and some are not quoted

Posted on 2009-04-27
Last Modified: 2012-06-22
Using VB.NET, what is the best way to extract from a CSV file where some fields have quotes and some do not have quotes?  I would prefer not to use schema.ini.

Thank you
Question by:MisterT25
    LVL 13

    Accepted Solution

    How about remove the quotes at the beginning?

            Dim fileContents As String
            fileContents = My.Computer.FileSystem.ReadAllText("C:\Test.csv").Replace("""", "")
            ' Continue with parsing here ...

    Author Closing Comment

    Good suggestion.  thanks for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now