Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions LINQtoCSV/CsvContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ private IEnumerable<T> ReadData<T>(

stream.BaseStream.Seek(0, SeekOrigin.Begin);
}

for (int i = 0; i < fileDescription.LinesToSkip; i++)
{
stream.ReadLine();
}

// ----------

Expand Down
3 changes: 3 additions & 0 deletions LINQtoCSV/CsvFileDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public int MaximumNbrExceptions
/// If set to true, wil read only the fields specified as attributes, and will discard other fields in the CSV file
/// </summary>
public bool IgnoreUnknownColumns { get; set; }

public int LinesToSkip { get; set; }

// ---------------

Expand All @@ -112,6 +114,7 @@ public CsvFileDescription()
UseFieldIndexForReadingData = false;
UseOutputFormatForParsingCsvValue = false;
IgnoreUnknownColumns = false;
LinesToSkip = 0;
}
}
}