How to Extract the All E Mails in the File Names

Hi,

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.
image

I think I should write something else here.
image

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

Any suggestion? What should I do ?

@sehz4d
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}

Regards,
Gulshiyaa

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.
image
So here is the file names in the excel
image

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?

@sehz4d
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