Fetch e mail from excel sheet


Hi Team
Hope you all fine I need you help to fetch email from datatable ,I this excel file and the record aprox 32000 Record there I need to fetch E-Mail from this list and save into other excel how can I achieve that please help me out

Hi u can write linq by using contains("@") or use regex expression

any exmple workflow

query=(from t in dt where t.ColumnName.contains("@") select t).ToDataTable();
or u can use method syntax.

Try This

Using Linq


I am getting complete row with fax but I need only e mail

my query is “(from a in DT1.AsEnumerable() where a(“Detail”).ToString.Contains(”@") select a).CopyToDataTable" this

u can try like this @Aleem_Khan

dt2= dt1.AsEnumerable.Select(Function(row) System.Text.RegularExpressions.Regex.Match(row(ColumnName).ToString, “(?<=Email:).*(?<=com)”).Value).CopyToDataTable

1 Like

Ok you can try this
in for each row
use isMatch/match activity. You can enter row.Item(“columnname”).ToString. You can select email regex pattern, the output u recieve from the activity will be the email id. The same cycle repeats for all rows

1 Like


I am facing Error

yes i did the same but in notepad file its working fine but i need to fetch data from excel

@Aleem_Khan - Please check this link for the Regex pattern…

1 Like


Prashant I am getting error copydatatable is not a member …

@NIVED_NAMBIAR - Could you please assist?

1 Like

Hi @Aleem_Khan

Sorry for late response
please check the below workflow
Main.xaml (7.7 KB)

Regards

Nived N

Happy Automation

nived solution to fetch e mail.zip (86.2 KB) thank you so much for helping me out but I am getting error " Add data row always through “Add Data Row: Object reference not set to an instance of an

Hi @Aleem_Khan

Can u Share the screenshot ?

Can u show the add datarow property panel

Also check the data added in add datatrow using writeline so as to check whether the data is empty or not

@Aleem_Khan - I have the xaml for your case. Please let me know if you are still facing issues.