Skip to main content
Solved

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


bo
Contributor
Forum|alt.badge.img+10
  • Contributor

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.

Best answer by erik_jan

How about the Counter transformer? Could you use that?

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • Best Answer
  • March 3, 2016

How about the Counter transformer? Could you use that?


bo
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • March 3, 2016
erik_jan wrote:

How about the Counter transformer? Could you use that?

Thank you, @erik_jan!


takashi
Influencer
  • March 3, 2016

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings