This project is read-only.

Get Record Row Index

May 17, 2010 at 2:43 PM


Is there a built in property, method or anything that returns the index (row number) of the current record?

For example in:

        using (var reader = new CsvReader(stream)) {

          foreach (var record in reader.DataRecords) {

            Task task = new Task {
              Client = record["Nome Cliente"],
              Comment = record["Commentarios"],

            Int32 i = record ??? Get row number of record in CSV file

Thank You,


May 22, 2010 at 12:16 AM
Hi Miguel, The CsvReader class has a RecordNumber property that you can use. Please refer to the docs for specifics on how it works. Best, Kent