Hi, I want to read and write all email Id with ";" separated in one Cell in excel sheet, where I have email id's row by row in excel

Hi, I want to read and write all email Id with “;” separated in one Cell in excel sheet, where I have email id’s row by row in excel. kindly help me , pls see the screen shot for reference

The image shows a table with a column titled "Email" and three entries: "xyz@abc.com", "abc@abc.com", and "ijk@abc.com". (Captioned by AI)

expected Output :
image

Hi @dinesh.pazhaniyandi

Use below Linq Query

Emails = String.Join(";", DT.AsEnumerable().Select(Function(row) row("Email").ToString()))

Regards,

@dinesh.pazhaniyandi,

  1. Use Read Range workbook activity to read the Email column. It will give you a Datatable. for example dtInput.
  2. Use assign activity like this
strOutput = String.Join(";"c,dtInput.AsEnumerable().Select(function(x) x.Field(Of String)(“Email”)).ToArray())
  1. Use Write Range or Write cell activity to write the strOutput back to excel file.

Thanks,
Ashok :slight_smile:

Hi Ashok ,

function(x) - > what is this X here?
and X. field

@dinesh.pazhaniyandi,

It’s just syntax we use in LINQ. you can any other name if you want for understanding. This x will hold a data row value while iterating through the data with LINQ.

x.Field will get the Email column value to compare.

Thanks Working fine this solution

Thanks You , working fine


String.Join(“;”, dtInput.AsEnumerable().Select(Function(x) x.Field(Of String)(“Email”)).ToArray())

@dinesh.pazhaniyandi,

Glad I was helpful. Kindly close the thread by marking my answer as solution.

Thanks,
Ashok :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.