c# - I have a CSV file where the Date and the time are into 2 fields. How can I use FileHelpers to aggregate the 2 fields into the same DateTime data? -
I have a CSV file where the date and time are in 2 fields. How do I collect 2 fields in the same date time data Can I use FileHelpers?
Thanks,
2011.01.07,09: 56,1.2 9 85,1.2 9 86,1.2 979,1.2981, 103 2011.01.07,0 9: 57, 1.2981,1.2982,1.29 79,1.2982,75 2011.01.07,09: 58,1.2982,1.29 82,1.2 9 76,1.2 9 77,83 2011.01.07,0 9: 59,1.2 9 77,1.2981,1.2 9 77, 1.2980 9 7 2011.01.07.10: 00,1.2 9 80.1.2 9 80.1.2 9 78,1.2 9 7 9 0101 2011.01.07,10: 01,1.2 9 80.1.2981,1.2978 , 1.2 9 78,57 2011.01.07,10: 02,1.2 9 78,1.2979-1.2977, 1.297886, 2011.01.07,10: 03,1.2 9 78,1.2 9 78,1.29 73,1.2 9 73,84 2011.01.07,10: 04,1.2 9 73,1.2 9 76,1.2 9 73,1.2 9 75,71 2011.01.07,10: 05,1.2 9 74,1 9 7, 1.2 9 74,1.2 9 77,53 2011.01.07.10: 06,1.2 9 77,1.2979, 19.91,1 9, 7 9, 7.11, 2011.01.07,10: 07.1.29 78,1.2 9 78,1.2 9 76,1.2 9 76,53 2011.01.07,10: 08,1.2 9 76,1.980, 1.2 9 76,1.2 9 80,58 2011.01.07,10: 09.1.2 9 79.1.29 85,1.2 9 79.1.2980,63
var fi Le = @ "2011.01.07,09: 56,1.2 9 85,1.2 9 86,1.2 979,1.2981,103 2011.01.08,0 9: 57,1.2981,1.2982,1.29 79,1.2982,75 2011.01. 09,09: 58,1.2982,1.2 982,1.29 76,1.2 9 77,83 2011.01.07,09: 59,1.2 9 77,1.2981,1.29 77,1.2980 9 7 2011.01.07,10: 00 , 1.2980.1.2980.1.2978,1.29790101 2011.01.07,10: 01,1.2980, 1.2981,1.29 78,1.2 9 78,57 2011.01.07,10: 02.1.2 9 78,1.2 9 779,1.2 9 77,1.2 9 78,86 2011.01.07,10: 03,1.2 9 78,1.2 9 78,1.2 9 73,1.2 9 73,84 2011.01.07,10: 04, 1.2 9 73,1.2 9 76,1.2 9 73,1.2 9 75,71 2011.01.07,10: 05,1.2 9 74,1.2 9 77,1.2 9 74,1.2 9 77,53 2011.01.07,10: 06.1.2 9 77,1.2 9 779,1.2 9 76,1.2 9 78,57 2011.01.07,10: 07, 1.29 78,1.2 9 78,1.2 9 76,1.2 9 76,53 2011.01.07,10: 08.1.2 9 76,1.2 9 80.1.2 9 76,1.2 9 80,58 2011.01.07,10: 09,1.2 9 79.1.2 9 85,1.2 9 79.1.2980,63 "; Var rows = file. Sample ( '\ N'); Forrest (different rows in rows) {var cols = row.Split (','); Var col1 = New date time (); (Curl == column [0]) / first call (var dateParts = col.Split ('.'); Col1 = New DateTime (Int. Debt Pearts [1]), Int. Purse (date pars [2])); } Else if (col == cols [1]) // second col {var timeParts = col.Split (':'); Col1 = col1.Adhaur (Int.sees (Time Purses [0])); Col1 = col1. Admins (Interse Pars (Time Purses [1])); //col1.Dump (); } And {// all other columns here}}}
Comments
Post a Comment