Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. string filePath = @"C:UsersNDownloadsshort1.csv";
  2.  
  3. string path = @"C:UsersNDownloadsTest.log";
  4.  
  5. StreamWriter SW = new StreamWriter(@path);
  6.  
  7. List<GResults> results = new List<G4Results>();
  8.  
  9. List<string> lines = File.ReadAllLines(filePath).ToList();
  10.  
  11. foreach (var line in lines)
  12. {
  13. string[] column = line.Split(',');
  14.  
  15.  
  16.  
  17. GResults newResult = new GResults
  18. {
  19. Dn = column[5],
  20. Te = column[9],
  21. Da = column[7],
  22. Se = column[0],
  23. Pa = column[6],
  24. Tomin = column[15],
  25. Tomax = column[16],
  26. Toact = column[17]
  27.  
  28.  
  29.  
  30. };
  31.  
  32. results.Add(newResult);
  33.  
  34. }
  35.  
  36.  
  37. foreach (var GResults in results)
  38. {
  39. SW.WriteLine($"{GResults.Dn} | {GResults.Te} | {GResults.Da} | {GResults.Se} | {GResults.Pa} | {GResults.Tomin} | {GResults.Tomax} | {GResults.Toact}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement