From text file to excel

I have a text file report and need to reform it into a excel file. Please find the text file format as below,

ABC Company…01-01-2018
DEF Department
Name…Age…Salary…Referral…date of employ
A…30…15000…15-05-2015
B…26…13000…08-08-2016
C…28…16000…D…09-02-2016

It is difficult to manage the data above as the referral column could be null. The (…) mean more than one space. Is there any way to reform it to an excel file?

About extracting table structured data, you can use below pattern inside Matches activity.
"(?-s)(\S+) (\d+) (\d+) (\S*) ?((0[1-9]|[12]\d|3[01])-(0[1-9]|1[0-2])-[12]\d{3})"
About retrieving data from match result, please refer to the link.

It is difficult to understand as a new user of Uipath. Could you explain more?

You can use Regex to search pattern occurrence inside text. There is an activity called Matches which is Regex finder.

After you drag and drop Matches activity, then set property.

1 Like

hey @Hugo_Pang
you can use generate data table.
check this video to understand in detail: Difference Between Build Data Table And Generate Data Table - YouTube

cheers,
parth

1 Like

Hey @Hugo,

Can you please provide some sample file so that it can be looked upon and some solution can be provided.

Thanks,
Shikhar

1 Like

Hi Yuji, is there any example of what should I input to the pattern property?

@Hugo_Pang Here.

Hi Yuji, I have some further questions. As after I match the data and build the datatable, it is unable to use the add data row activity. How could I add the data into the datatable in order to create an excel report?

You can use this activity. Then set array of string in array row property.
https://docs.uipath.com/activities/docs/add-data-row

Thx for your help. However, I match the data as string and it is unable to be the input of the Add Data Row activity

You can iterate through array of string and input data one by one into array.
And Use add row activity at the end of loop.

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