public Dictionary <String, Object> readLine(string Line) { try { Dictionary <string, object> stringFields = new Dictionary <string, object>(); int duplicatedNames = 0; foreach (LineDataSpec field in outLine.lineFields) { if (!(field.Name.Equals(outLine.lineFields.Last().Name))) { string value; value = Line.Substring(Convert.ToInt32(field.StartsAt) - 1, Convert.ToInt32(field.Length)); try { stringFields.Add(field.Name, Formater.DeletePaddings(value)); } catch (ArgumentException) { duplicatedNames++; stringFields.Add(field.Name + duplicatedNames, Formater.DeletePaddings(value)); } } } return(stringFields); } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } }
public Dictionary <String, Object> readLine() { if ((currentLine = reader.ReadLine()) != null) { Dictionary <string, object> stringFields = new Dictionary <string, object>(); int duplicatedNames = 0; foreach (LineDataSpec field in outLine.lineFields) { if (!(field.Name.Equals(outLine.lineFields.Last().Name))) { string value; value = currentLine.Substring(Convert.ToInt32(field.StartsAt) - 1, Convert.ToInt32(field.Length)); try { stringFields.Add(field.Name, Formater.DeletePaddings(value)); } catch (ArgumentException) { duplicatedNames++; stringFields.Add(field.Name + duplicatedNames, Formater.DeletePaddings(value)); } } } return(stringFields); } else { EndReached = true; return(null); } }
public Dictionary <string, object> readLine(string line) { Dictionary <string, object> Processed = new Dictionary <string, object>(); string[] info = line.Split(delimiter); for (int i = 0; i < info.Length; i++) { Processed.Add(Keys[i], Formater.DeletePaddings(info[i])); } return(Processed); }
public Dictionary <string, object> readLine() { if ((currentLine = reader.ReadLine()) != null) { Dictionary <string, object> Processed = new Dictionary <string, object>(); string[] info = currentLine.Split(delimiter); for (int i = 0; i < info.Length; i++) { Processed.Add(columns[i], Formater.DeletePaddings(info[i])); } currentRow++; return(Processed); } else { EndReached = true; return(null); } }