How to increment counter

hello everyone
master data.xlsx (21.1 KB)
In this file their is Student worksheet in which I have work
There is a column name Student Id Where I write some Ids
I want to increment integer value

example: IQIN0005 this is the last value in the sheet. form now we want increase integer value
I want output like: IQIN0006
IQIN0007 and so on


Can you try the following expression?

newString = System.Text.RegularExpressions.Regex.Replace(oldString,"\d+",Function(m) (Int32.Parse(m.Value)+1).ToString("D"+m.Value.Length.ToString))


Hi @lakshya_garg1

Please find the attached xaml file
with input & output excel

test13.xaml (7.1 KB)
master data (1).xlsx (12.5 KB)

Hope it solves your isue


Thanks for helping
but Tell me about this statement. (prefix+index.ToString(“0000”))

What is the meaning of this statement.

Main.xaml (17.1 KB)

Your File is work properly as I want
but When I put this activity in my project it’s throw an exception. I’ll attach my project. so that it’s easy for understand

Hi @lakshya_garg1

please share the input excel files so that i could get the error