How to Move the Regex data into Excel file?

I am using regex expression where I have used the Regex expression to extract the specific content from the large data. Now I want to save this data into excel can you guide.

@pavanh003 , @Palaniyappan can you plz guide. Thanks

2 Likes

Buddy you can write with write cell activity buddy if its of single value been received
if it is of many values obtained from a loop iterating the matched values in matches
then u can use write cell with range alone been incremented with counter like this
in write cell you can mention the range like
“A”+Counter.ToString
where counter is a variable of type integer with default value of 1 (if there is no column) and if there is a column mention with default value of 2
and once after the write cell with this range mentioned use a assign activity to increment the value of counter like this
counter = counter + 1

Thats all buddy you are done
Cheers @balkishan

1 Like

yes @Palaniyappan I am extracting multiple value not a single value.

Like Number, Duration, rate etc from the content.

Fine then for each value you can use add data row activity buddy like if the number is stored in A column and Duration is stored in B column and Rate is stored in C column you can mention like this in arrayrow property in add data row
{out_match(0),out_match(1),out_match(3)}
where out_match is the variable you get from matches

Cheers @balkishan

1 Like

Great, Tell me on thing for each value extraction I have to diff - 2 match activity or one activity. Here I got only one variable where I have stored the value.

Buddy sorry i didnt get this @balkishan

1 Like

Hi Balkishan,

you will get IEnumberable collection as output of the matches activity and then use build datatable to create a datatable and using for each of IEnumberable collection use add datarow to add the value to the datatable and write range to write to excel.

Let us know if this helps.
Regards,
Pavan H

1 Like

It’s not going into the Loop, can you check plz is it fine ?

buddy change the type argument buddy @balkishan

2 Likes

Hi,
Give your input string and regex pattern in input and then build a datatable with out any number of rows, only columns should be there and once that is done go to for each of regex output, use add data row activity to add to the datatable.

Let us know if this helps,
Regards,
Pavan H

1 Like

Into DataTable or any other type arguments.?

Is loop fine I have used the for each loop for value, or I have to used for for each data loop?

1 Like

in add data row how you are passing value to array row buddy @balkishan
can i have a screen shot of that property
Cheers

sorry bro didn’t get, but I already done that part.

image

This RegexData is a Enumeration type variable which created in Match Activity.

buddy before writing to arrayrow
check if this RegexData(0) is printing any value with write line activity inside the for eachloop buddy
Cheers @balkishan

1 Like

I gave debugpoint it’s not going inside the loop bro.

No buddy
put this write line inside the for each loop buddy and mention like this in the writeline activity buddy
RegexData(0).ToString

remove the break point in add data row, or better delete the add data row and lets check whether the value is been obtained from the matches output variable RegexData or not
Cheers @balkishan

I put inside the loop also bro, But it’s not going inside the loop, It’s terminated before the loop,

buddy i think the matches activity is not giving any value @balkishan

1 Like