Skip to content

Can CsvHelper store the CSV row number in the mapped object? #1689

Answered by jzabroski
reloaded asked this question in Q&A
Discussion options

You must be logged in to vote

@JoshClose I think you should convert this to a Discussion and select the answer so that you can update the answer as you progress CsvHelper.

e.g.,

v23 (current):

Map(m => m.LineNumber).Convert(record => record.Row.Parser.Row);

v21:

Map(m => m.LineNumber).Convert(row => row.Context.Row);

v13 - v20:

Map(m => m.LineNumber).ConvertUsing(row => row.Context.Row);

v12:

Map(m => m.LineNumber).ConvertUsing(row => row.Context.RawRow);

Replies: 11 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@IanKemp
Comment options

@JoshClose
Comment options

@jzabroski
Comment options

@danielekiyoyo
Comment options

@Venumadhavi-stack
Comment options

Answer selected by JoshClose
Comment options

You must be logged in to vote
5 replies
@Venumadhavi-stack
Comment options

@JoshClose
Comment options

@Venumadhavi-stack
Comment options

@JoshClose
Comment options

@jsnape
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #845 on February 03, 2021 21:50.