Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

pasing csv files

Posted on 2004-10-21
2
Medium Priority
?
229 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
Comment
Question by:eekj
2 Comments
 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 1000 total points
ID: 12377850
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:
TheAvenger earned 1000 total points
ID: 12378440
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

916 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