0

I want to validate the email in Csv before uploading.Do we have any option to validate the email in Epplus.

I don't find any code for validating Email address in excel and csv using Epplus. Can anyone help on this.

Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236
  • Neither Excel nor Epplus have anything to do with email validation. You'll have to validate your data while loading it. You'll find several thousands of articles, snippets and dozens of SO questions about duplicating email addresses in code. Depending on the library/code you use to read the CSV file you may be able to filter invalid addresses in a loop or by using a LINQ query – Panagiotis Kanavos Nov 13 '17 at 12:20
  • no,this validation is to find the format of email address in Epplus not in .NET framework.for example email address have a symbol '@'.so this should be validated.so asking about this kind of validation – sai krishnan Nov 13 '17 at 12:24
  • I understood what you typed. This has nothing to do with Excel or Epplus. Or even ASP.NET. *Your code* has to provide the validation logic. You can use the `MailAddress` class as a shortcut, or the [regular expressions posted here](https://learn.microsoft.com/en-us/dotnet/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format). – Panagiotis Kanavos Nov 13 '17 at 12:27
  • I am asking validation in EPplus not in .NET framework.Please read the question fully – sai krishnan Nov 13 '17 at 12:28
  • There is none, because that's not the job of EPPlus or any file converter or library. Is it so hard to type the 2 lines required to validate the data? Or are you asking about something unrelated, like [configuring data validation in Excel](https://support.office.com/en-us/article/Apply-data-validation-to-cells-29fecbcc-d1b9-42c1-9d76-eff3ce5f7249) ? This is unrelated to CSVs, it has to do with formulas – Panagiotis Kanavos Nov 13 '17 at 12:30
  • thank you.i got it – sai krishnan Nov 13 '17 at 12:31

0 Answers0