Need Regex Range Number Excel

Hello all,

Sorry for the old topic being closed.
@arjunshenoy support me getting the number container but need to change like below. Thank all
image

RegExProcess.zip (1.5 MB)

Hello

Do you need the output that is Column B?

If so, here is a regex pattern you can use to get the values:
(?<=CONTAINER. NO/SEAL. NO: )[A-Z]{4}\d+

Preview Regex

Cheers

Steve

Hi @Steven_McKeering

Output as from A9

Since you need a space between the alphabets and the numbers, you’ll have to extract them separately using 3 different regexes, and apply the logic you want to add a space between them and a dash before the last digit.

First regex to extract the alphabets: (?<=NO: )[a-zA-Z]{4}
Second regex to extract 6 digits: (?<=NO: [a-zA-Z]{4})[0-9]{6}
Third regex to extract the final digit: (?<=NO: [a-zA-Z]{4}[0-9]{6})[0-9]{1}

Then you could combine the values together like so: String.Format("{0} {1}-{2}", FirstRegexOutput, SecondRegexOutput, ThirdRegexOutput)

1 Like

Hi,

Can you try to modify your expression in the InvokeCode activity as the following?

row("Extracted Data") = System.Text.RegularExpressions.Regex.Match(row(0).ToString,“([A-Z]{4})([0-9]{6})([0-9]{1})”).Value.Insert(10,"-").Insert(4," ")

The following is result of the above.

image

Regards,

2 Likes

I want to output at A2, pls check help me again
image

image

Hi,

How about using RemoveDataColumn activity as the following?

Result:

image

Regards,

1 Like

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