Click here to Skip to main content
15,891,855 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I would like to know how I could import a txt file that has thousands of delimited numbers into a dataset and apply different formulas on the imported data similar to how excel functions. For example this is the txt file data:

001
TEST1
21.03.2013
12:20:45
010
10000
00900
0500
4000
0100
0198
02845
01040
1
1
0
0
1
01
000.0
+01.1



Formulas are applied to the number and the return values are input into a form. The return data is also used to graph.

Excel does this easily. How do I incorporate this into my application?
Posted
Comments
Surendra Adhikari SA 18-Jun-13 3:24am    
why not use xml for hold this type of data?

1 solution

Loop thru the text file and insert values into a dataTable then query the dataTable with LINQ or lambda expressions. I don't understand the above format - it is a single value per line, does this pattern repeat - how many lines before repeating - are all questions you need to solve how to parse it. Columns are for the field types, number of fields per record and the rows are for the records that hold the values for each column. Once you get that solved we can help with the expression to get the results.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900