Solved

How to get the row number (such as 1, 2, 3...) of each row in a data set?

  • 3 March 2016
  • 3 replies
  • 101 views

Badge +2

Thought this would be easy, but we are struggling to assign a newly created attribute with row numbers that indicate its sequence in the set.

icon

Best answer by erik_jan 3 March 2016, 21:53

View original

3 replies

Userlevel 2
Badge +16

How about the Counter transformer? Could you use that?

Badge +2

How about the Counter transformer? Could you use that?

Thank you, @erik_jan!

Userlevel 2
Badge +17

Hi @bo, I agree that the Counter is a generic solution. Alternatively, in some formats, you can also use a predefined format attribute that stores the row number. e.g. "csv_line_number" for CSV. Check the Format Attributes tab of the reader feature type properties dialog.

Reply