Question

I have a file names.txt with this data:

NAME;AGE;
alberto;22
andrea;51
ana;16

and I want to add a new column N with the line number of the row:

N;NAME;AGE;
1;alberto;22
2;andrea;51
3;ana;16

I've been looking and what I found was something related with Add sequence. I tried but I don't know how.

Thank you very much.

Was it helpful?

Solution

The Add Sequence step will get the job done, but you don't even need that. Both the CSV file input and Text file input steps can add a row number to the input rows. For the 'CSV file input' step it's called 'The row number field name (optional)'.

For Text file input, check the 'Rownum in output?' box on the Content tab and fill in the 'Rownum fieldname' text box.

I'm really baffled why you couldn't figure out the Add sequence step. It should work with no changes at all. Just drop it in and connect the output of the csv file to it and the sequence should appear as a field name called 'valuename'. I would change that personally, but still, it should work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top