Click here to Skip to main content
15,886,809 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
How to find candidate email Id from a resume (word or pdf file) in asp.net during bulk upload...I am able to extract the email ids..But how to get exactly the candidate email id from a CV...
Posted

Hi,
You can define the email pattern by using the RegEx then you can find the email address in doc.

Please refer below URL
http://www.codegain.com/articles/officedev/howto/how-to-extract-email-address-from-the-word-doc-using-c-sharp.aspx[^]
 
Share this answer
 
Comments
Abhinav S 2-Feb-13 13:14pm    
Neat link.
Korathu 2 3-Feb-13 0:11am    
Email Ids already extracted.But I wish to get the candidate email id alone from a resume..How can one get exactly that if there are multiple email ids in the resume ...
Korathu 2 3-Feb-13 0:15am    
I mean how to extract email ids from the word or pdf(resume) file)...I am able to extract..But if there are multiple email ids how can one get the exact candidate email id....Actualy i wish to insert only the candidate email id and filename from the resumes into database
during bulk upload...
Joezer BH 3-Feb-13 1:20am    
Then you need a known pattern of the CV in order to avoid other emails, like of a company etc.

Otherwise, you can't be sure which email is the candidate.
try this code...it is in following way..it possible using Regx...
1.Map your resume folder.
2.Fect all file in FileInfo[].
3.Retrive using for
4.read file using reader
5.Give email patter.
6.pass that data to regx match method in for loop...

StreamReader reader;
        int openIndex;
        string resume_data;

 string pattern = @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";

        DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/resumes"));
        FileInfo[] rgFiles = di.GetFiles("*.doc");
        foreach (FileInfo fi in rgFiles)
        {
            
            resume_data = "";
            reader = new StreamReader(fi.FullName);
            resume_data = reader.ReadToEnd();
            reader.Close();

	foreach (Match m in Regex.Matches(resume_data , pattern))
            {
                txtEmailds.Text = txtEmailds.Text + "  " + m.Value;
            }
	}

...try as demo..it is working on my side ...try by implementing your logic as per ur requirements....
also search for "Regx class in c#.net" on Google...study it...
go through following link...
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.matches.aspx[^]
....hope it will help u
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900