Solved

pasing csv files

Posted on 2004-10-21
221 Views
Last Modified: 2010-04-15
Hi,

I need to process a csv file and break it up into its correct columns.

A line may look like this:
"some text, blah blah", itemcode, price, "some ""more"", text"

and needs to end up like this:
some text, blah blah
itemcode
price
some "more" text

Could you please suggest an easy way of doing this?

Thanks.
0
Question by:eekj
    2 Comments
     
    LVL 18

    Assisted Solution

    by:armoghan
    One way is to use the regular expressions to split the array
    http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20914780.html

    Other way is to convert the File to Excel file and then you can connect to it and get the data

    something like this
    http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20607244.html
    0
     
    LVL 20

    Accepted Solution

    by:
    The easiest and I think best way is to use an OleDb connection to the file. There are a lot of examples on the net. Thry this one:

    http://weblogs.asp.net/bhouse/archive/2003/09/10/27036.aspx

    And just google for something like OleDb CSV file -> it returns really a lot of results and options.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Anonabox PRO Tor & VPN Router

    PRO is the most advanced way to fortify your privacy and online anonymity by layering the Tor network with VPN services. Use both together or separately, and without needing to download software onto your devices.

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Want to pick and choose which updates you receive? Feel free to check out this quick video on how to manage your email notifications.
    Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

    875 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

    14 Experts available now in Live!

    Get 1:1 Help Now