Splitting a datacolumn from a datatable into the correct columns

Used datascraping to extract a table.
howeverm it only managed to extract everything in a column only.
How should i split them into the respective columns?

e.g.
the actual DT in the web:

No.|Name|Age|Address|ID
1 |Aly |23| asdasd | 123
2 |Ady|24|asdads | 456

but data scrap only managed to extract:
No.
Name
Age
Address
ID
1
2
Aly
Ady
23
24
asdasd
asdads
123
456

is there any way i can convert the extracted to the desired dt?

Hi,

If you selected “Yes” the following question, can you try to select “No” then choose columns one by one?

image

If the above doesn’t work, it may be necessary to translate it to proper schema using some logic.

Regards,

Hi, the above question did not pop up.

Hi,

How about to indicate element without header? Can you share screenshot of the original table and information for these element by UiExplore etc?

Regards,

Hi, i cant share the UI, but there was no way to extract the table, the only way im able to extarct is the outcome only with 1 column(all other column’s data squeezed into 1). but what about if we extract as 1 column then use some logic to split it?

Hi,

How about the following sample?

Sequence.xaml (12.1 KB)

Regards,

@TyraS

Please check the sample here…if there are 5 columns you can use directly else change the number 5 in the code to whatever column numbers you have

Output:
image

Used generate datatable with column separator as Newline and row separator as comma after using regex to replace commas where needed

Sequence7.xaml (9.2 KB)

Hope this helps

cheers

hi, i cant open the xaml file. It says invalid document

hi, i tried to run, the output is the same, only 1 column

@TyraS

Please try this

BlankProcess - Copy (5).zip (5.5 KB)

check sequence7.xaml in this

cheers

Hi,

Did you try the above sample as it is? Or modified it for your data?

If possible, can you share your datatable as xlsx using WriteRangeWorkbook activity?

Regards,

hi, yes using the sample as it is

Hi,

The above workflow outputs the following workbook named result.xlsx. Can you check this?

image

Regards,

not sure what’s the issue, but when run the program, there is no error, yet the excel is empty.

Hi,

Can you try the following project? (I uploaded the whole project.)

Sample20230703-2aL.zip (3.1 KB)

Regards,

@TyraS

Did you happen to try the above sample?

cheers

hi somehow i tried debug and it works. what if, there may be different no of rows/columns in the future? i just need to change the 5 to the new number of columns, but for rows? no. of columns would rarely change, but the rows tends to be different most of the times.

its still unable to open due to invalid document. but i realised that the output is different from what i need.

Hi,

In the above sample, number of row of result datatable is calculated from number of columns : 5 and total rows. So, this assumes there is no empty cell in the result datatable.

Regards,

@TyraS

You can use “Generate Data Table from Text” Activity. In which you can pass your string Variable which contains Data Table data and use seprator as New Line. Save the Output in the new Variable of type Datatable.

Hope this will work!