Optional RowNumber column when reading excel


Judging by our use cases and also questions that pop up on the forums, that’s a pretty common situation to read -> verify/perform actions -> write status to same file (essentially an excel based queue).

It would be useful to have an optional RowNumber column added when using ReadRange on Excel files, possibly with a parameter for offset.
I’m thinking of adding 2 parameters:
bool AddRowNumberColumn
int RowNumberOffset

Possibly the offset could be calculated from the Range parameter if flag is true, but offset not specified.

This would enable easier update of excel rows - instead of keeping a separately tracked index, we’d be able to have it in the row itself. Since it would be added on read step, modifying the DT (f.e. deleting rows) wouldn’t mess it up and there would be no need for index offsetting on deletion.

RowNumber column could be marked as AutoIncrement with seed 1.


1 Like


Hello Andrzej.

That’s a great idea. I implemented that type of functionality over an excel file countless of times and I agree especially if you need to filter some of the value before hand.

I don’t know about specifying the offset. I think we can just calculate it using the selected range, if you need a different offset you can do the changes inside the datatable.

Appreciate the idea.