How To Extract E Mails From File Names By Using "Matches Activity" and Write Them in Excel

Hi everyone,

I have a file within it there are txt files . All the files name include “e Mail + Name Of The Person”
The thing I want to do is extract only eMails by using “Matches activity” and write them in the excel file .But only the e Mails.

image This folder is on Desktop.

These are the files that I want to extract eMails from them.

I am able to extract the filename and write them by using write line acitivity when I don’t use the “Matches Activity”.

but when I include the “Matches” Activity it gives me this text lines in the output panel.

Here is my workflow, the folder and screenshot.

SelectFolderandExtractEMail.xaml (8.4 KB) (1.1 KB)

I want to extract the eMails and write them in the excel file. If it’s available I want to extact the names in another column next to the mail.

Thanks for your help in advance

Happy Automations :slight_smile:

Hey Sehz4d.

What you get out is a IEnumerable of matches, which you can see as a collection. So even though, you only have one item in your collection, you still need to specify that you want the first item.

You can just change your ‘Write Line’ to email(0).ToString in order to achive that.

Kind regards, Anders

Ps. I’ve made this UiPath and RegEx tutorial for further reference, but looks like you are at an advanced level yourself


It worked. I didn’t realize that. Thank you very much @AndersJensen.

By the way I’m the 868th subscriber in your channel :grinning: Really liked your channel. Plese keep making good jobs.

Thanks again

1 Like

Awesome. Most often it’s just a tiny setting, that is wrong - like here :slightly_smiling_face::+1:

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