Solved

Visual Studio 2010 - Import CSV data, data mine, show in form for user, then output as text

Posted on 2011-03-19
3
1,262 Views
Last Modified: 2013-12-17
I am looking to grab either a txt, csv, and excel file(whichever would be easier I can get whichever format from the program we are getting it from), import this data in my VS2010 program(windows form or WPF), data mine this to pick out only certain pieces, then display to user, letting them add or edit, then output to a txt file.  What is the best way to do this nowadays?  
0
Comment
Question by:ITSuperman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 35172628
the textfieldparser is an efficient way of parsing a text file: http://emoreau.com/Entries/Articles/2010/05/Do-you-know-the-TextFieldParser.aspx
0
 
LVL 9

Assisted Solution

by:Hawkvalley1
Hawkvalley1 earned 250 total points
ID: 35173260
I like to import raw data in a datatable if it's contents are symmetrical (rows and columns). CSV example, but this could be txt as well if comma separated.

Dim dt As New DataTable
'add columns
dt.Columns.Add(<name of column>)
'repeat as needed

Using sr As New StreamReader(<path to file>)
  While Not sr.EndOfStream
     dt.Rows.Add(sr.Readline.Split(","c))
  End While
End Using

Open in new window


Then make LINQ queries to it and display the query. DataGridView are great for displaying datatables.    
 
0
 
LVL 3

Author Comment

by:ITSuperman
ID: 35173965
Thanks to you both for your help!  I am working on manipulating the data now into the form.  
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

733 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