Copy particular from a cell and paste in in other cell

I have below example excel sheet with me .
image
i am want below result.
image
how can i do this?

Everytime it contains 3char and 3digits correct?

Hi @Hemant_Deshmukh ,

Try below workflow, hope it work for you

Test.zip (8.9 KB)

Thanks,
Vinit Mhatre

Hi @Hemant_Deshmukh

→ Use the read range activity and store the data in a variable say dt.
→ Use the for each row in data table and the loop the table.
→ Use the assign activity and assign the dt1 = dt.Clone()
→ Use assign activity within the For Each Row in Data Table

Input = CurrentRow(1).ToString

place an if condition after the assign activity and pass the codition as:


System.Text.RegularExpressions.Regex.IsMatch(Input,"[A-Z]+\d+")

In then sequence give assign as below

CurrentRow(0) = System.Text.RegularExpressions.Regex.Match(Input,"[A-Z]+\d+").Value

Use the add data row activity after the if condtion and pass the row field as

 {CurrentRow(0).ToString,CurrentRow(1).ToString}

In the data table field pass the dt1

at last after the for each row in data table use the write range activity and pass the excel file name and sheet name as required. Later pass the dt1 in data table field.

Regards

it could be 3 char and 3 digits or 7digit like 0214754

Hey @Hemant_Deshmukh

Please find the updated workflow it will help you achieve your automation

Main.xaml (17.5 KB)

Regards,
Sreejith S S

HI @Hemant_Deshmukh ,

Try the attached process; if you have any questions, you can ask anything; if it works for you, mark it as a solution; it will help others as well.

Regards,
Vinit Mhatre

Hi @Hemant_Deshmukh

→ Read Range Workbook (Remove Add Headers option in Properties)
image
Output-> dt
→ Use below code in Invoke Code

Dim modifiedDataTable As DataTable = YourDataTable.Clone() ' Create a clone of the original DataTable without headers
modifiedDataTable.Columns.Add() ' Add a new column for the account number

Dim currentAccountNumber As String = "" ' Variable to hold the current account number

For Each row As DataRow In YourDataTable.Rows
    Dim match = System.Text.RegularExpressions.Regex.Match(row(0).ToString(), "([A-Z]+\d+)")
    If match.Success Then
        currentAccountNumber = match.Groups(1).Value ' Extract the current account number
        modifiedDataTable.Rows.Add(currentAccountNumber, row(0)) ' Add a new row with the "account no :" line
    Else
        modifiedDataTable.Rows.Add(currentAccountNumber, row(0)) ' Add a new row with the current account number
    End If
Next

YourDataTable = modifiedDataTable

Invoked Arguments:


→ Use Write Range Workbook
image

Check the below zip file
BlankProcess29.zip (154.9 KB)

Happy to help if you have any queries
Regards

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.