Parser weitergeschrieben
This commit is contained in:
@@ -23,12 +23,25 @@ namespace CSVParser
|
||||
|
||||
foreach (string partial in Input)
|
||||
{
|
||||
UVcsvStrukture strukture = new UVcsvStrukture();
|
||||
string[] parts = partial.Split(',');
|
||||
string datum = parts[1];
|
||||
string uhrzeit = parts[2];
|
||||
|
||||
|
||||
if(!DateTime.TryParse(datum + " "+uhrzeit,out zeit))
|
||||
throw new Exception("Konnte die datum uhrzeit nicht konventieren");
|
||||
|
||||
double.TryParse(parts[3].Replace('.', ','), out temperatur);
|
||||
int.TryParse(parts[4], out geschwindigkeit);
|
||||
double.TryParse(parts[5].Replace('.', ','), out druck);
|
||||
|
||||
strukture.Zeitstempel = zeit;
|
||||
strukture.Druck = druck;
|
||||
strukture.Geschwindigkeit = geschwindigkeit;
|
||||
strukture.Temperatur = temperatur;
|
||||
|
||||
result.Add(strukture);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user