Hot to create a datatable from parts of strings contained in a list

Hi,

I write this post because I’ve a list of strings extracted from a full text scrapping (data scrapping not possible):

{
A POUR

CONCUBIN

TOTO FURE

25402136

Action
Définir comme interlocuteur
Détail du lien
Modifier le lien
,
EST

PARENT: REPRESENTANT LEGAL

TETE TURE

05415249

Action
Définir comme interlocuteur
Détail du lien
Modifier le lien
,
EST

PERE

TITI TUBO

54851245

Action
Définir comme interlocuteur
Détail du lien
Modifier le lien
}

And I want to make a datatable with three columns. For example, for the first row I want from the first string in the list:

Column1: A POUR CONCUBIN
Column2: TOTO FURE
Column3: 25402136

For the second:

Column1: EST PARENT: REPRESENTANT LEGAL
Column2: TETE TURE
Column3: 05415249

And this for all the elements in the list.

Can you help me?

Thanks

From your data, we have a pattern.

  1. First create one data table using Build Data Table Activity (3 columns).
  2. create an array of strings with the extracted text by splitting the strings with new line, strArray = Array.Split(text,"\n")
  3. Delete the empty strings from an array strArray
  4. For i=0 to strArray.Length-1
    → if (Double.TryParse(strArray(i)))
             if condition is true, the string is a number
                      column1value = strArray(i-3) + " " + strArray(i-2)
                      column2value = strArray(i-1)
                      column3value = strArray(i)
                      Create a Data Row with these values and row to DataTable