Forum Discussion

vikassardesai's avatar
vikassardesai
Occasional Contributor
5 years ago
Solved

Is there any way to retrieve csv row numbers

I have suppose 15 records in csv. and with each record I want to update some value say if there is first row then the value should be "Val_1". For second record, it should be "Val_2" and so on.  So...
  • tristaanogre's avatar
    5 years ago

    The CSV records don't have native Row numbers.  What I would do is, since I'm assuming you're using something like DDT.CSVDriver to drive reading your file, is to just put a counter in your while loop to increment each time through, tracking the numbers.  Then utilize that counter to append your values.