IENumerable<Match> Regex Group fast way to Datatable

Hi Friends,

is there a fast way exitend to get the results of the Match activity (a IENumerable) to a datatable? I got like 4000 matches and want to store them in a datatable, looping through the IEnumerable results is to time intensive.

A solution could be strOut = string.join(ā€œ,ā€,ieNumerable) but this option gives me the whole IENumerable and I want just the group.

For the moment my only solution would be looping through ieNumerable(counter).Groups(1).

Any help is very appreciated!

lets assume the datatable has only 1 col then give a try:

create an empty datatable with the column - dtResult
use an assign activity
left side: dtResult
right side

(from m in IENumerable.Cast(of Match)
Select dtResult.Rows.Add(m.Groups(1).toString)).CopyToDataTable

2 Likes

Iā€™m kind of crying because I have wasted hours in googeling this. Worked like a charm.

Can you tell me how I have to adjust the formular on a multiple col datatable?

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