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,266 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

Technology Partners: 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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 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