How to split the long string into each word then copy/paste into each column in excel file when we use the regex pattern (Matches)

Hi All,
In my scenario, i need to read the text file and have to split the respective string then copy/paste into each column in excel file.
I am struggling to split the string as well as regex pattern (Matches) for certain lines.
PFA… for my xaml file and for the expected output in excel fileRegexPattern.zip (21.2 KB)
ExpectedOutput_ERN0.xlsx (9.6 KB)

1 Like

Hi @maxxmuthu,

You can split the string by your delimiter, Suppose you want to split your text with spaces, use

YourString.Split(" ")

Then you can iterate over this array and paste in to corresponding cells.

@RupeshGonte
Thanks for the reply.
Can you give me some examples ? it will be helpful. In below cases i need to split each word except “NAME:”

Eg:"NAME: CALLARI SYLVIA HIC 1226643301 ACNT: I6373166S720064 ICN 8195E01477 ASG Y MOA: "

Note - Above values will differ for each line in my case.

Hi,
You can use regex to take what ever is there after NAME: and then you can use split(regexOutput.cast(of Object).first.tostring," "), assgn this to a array and then for each item you can write to excel.

Let us know if this helps,
Regards,
Pavan H

2 Likes