Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. private List<Summary> deserializeCSV(string pSource, int pageSize)
  2. {
  3. List<Summary> ret = new List<Summary>(pageSize);
  4.  
  5. string[] lines = pSource.Split(new char[] { 'n' });
  6.  
  7. Parallel.For(1, lines.Length - 1, i =>
  8. {
  9. string[] col = lines[i].Split(',');
  10. ret.Add(new Summary
  11. {
  12. Complaint_Type = col[0],
  13. Product = col[1],
  14. ProductGroup = col[2],
  15. Brand = col[3],
  16. Each_UPC = col[4],
  17. SUBJECTCATEGORY_DESC = col[5],
  18. GROUP_DESC = col[6],
  19. SUBGROUP_DESC = col[7],
  20. SUBJECT_DESC = col[8],
  21. State = col[9],
  22. CITY = col[10],
  23. FullZip = col[11],
  24. Zip = col[12],
  25. IssueDate = DateTime.Parse(col[13]),
  26. ComplaintsCount = Single.Parse(col[14]),
  27. Gender = col[15],
  28. AgeBucket = col[16],
  29. Population = Single.Parse(col[17]),
  30. _RowID = int.Parse(col[18]),
  31. _RowIDComp = int.Parse(col[19]),
  32. ComplaintsCount_New = Single.Parse(col[20]),
  33. Population_New = Single.Parse(col[21]),
  34. Country = col[22],
  35. _ID = long.Parse(col[23]),
  36. C40_CODE = col[24]
  37. });
  38. });
  39.  
  40. return ret;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement