Regex Range Excel

Hi all,
I have excel file. How I can get number : CONTAINER / SEAL NO.: TCNU6087868/HAS 1482677 → TCNU 608786-8
image

Result.xlsx (8.6 KB)

Hi @anh.nguyen

You can use the following RegEx pattern:

TCNU\d+(?=/)

Hope this helps,
Best Regards.

Hi,

How can I change for all number Con like that ?

@anh.nguyen

  1. Read the excel file in a datatable.
  2. Use a for each row in datatable activity to iterate through each row.
  3. Inside the loop, use an assign activity to get the TCNU of each CurrentRow in a variable :

rowTCNU = System.Text.RegularExpressions.Regex.Match(CurrentRow(“ColumnName”).ToString,“TCNU\d+(?=/)”).Value

Hope this helps,
Best Regards.

1 Like

Please find attached file
Strings2.xaml (12.8 KB)

Hope this is what you are looking for

Regards

1 Like

Can get all num Con, why at start at row10? can you help me check file xaml and add Titles: Container Num. Thank
image

TestAutomation.xaml (13.6 KB)

in write cell try this

Hope now you should able to write from A1

Regards

1 Like

Hi @anh.nguyen ,

Check this below workflow attached,
Uipath_RangeRegex.xaml (15.2 KB)

Output Screenshot:

Hope this might help you :smiley:

1 Like

Thank all, I use assign but do not show titles at A1
how can I add Titles


image

@anh.nguyen ,

You can write the title in the A1 cell position before the for each starts.

1 Like

@anh.nguyen

Updated the workflow & attached the same for your reference. Please try the same & ley us know if it works for you.

RegExProcess.zip (143.8 KB)

Output:

image

Hope this helps,
Best Regards.

1 Like

Thank you so much :slight_smile:

1 Like

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