How to Extract the All E Mails in the File Names


I want to extract the emails in a folder and write them to the excel file.

I have created the workflow. But I think I am missing something.

It throws this error.

I think I should write something else here.

My another question How can I use the Replace activity here? To extract the only eMails in the file names.
What should I write in this fields? I am confused a little bit :slight_smile:

Any suggestion? What should I do ?

the exception is indicating that more items as columns exists are tried to insert.
refering to your screenshot there is only 1 column.

So add a second column or remove one item for the add datarow

About the second question. On what / which trigger you want to use for the detection. Share a sample for an email and share a sample for a non email

1 Like

Hi @sehz4d

In Add data row activity in input Array row use only item.{item}


1 Like

Hey @ppr thanks for your reply.
I was able to do it by adding second column. But I donโ€™t get it why it throws such an error.

I want to get only the Emails which are in the file names.

Letโ€™s say these are the files.
And the file names starts with e Mail + Person Name. In this case I want to extract only the emails and write them in the excel.
So here is the file names in the excel

How can I extract the emails and write them in a separate column? I know that I can use Regex but how to loop for each file name?

Maybe I misunderstood you, have a look on the different parameters of getFiles

maybe following filter will already do it:
Directory.GetFiles(YourFilePath, "@.txt)

for extrating the email from filename you can use a Match Acitivity or Regex.Match method