hello friends
i want to read column from excel called company name that have 100 company name and save it in the list without repetitive the company name
how can i do that?
Hi!
you can achieve this by using the
datatable.DefaultView.ToTable(True,“Column Name”)
please refer:
Regards,
NaNi
-
Use Read Range activity to read the data from Excel file and it will give output as DataTable. Let’s say InputDT.
-
And then use below expression to remove duplicate company names from Company column.
CompanyDT = InputDT.DefaultView.ToTable(True,"Company Name")
-
And then use Output DataTable activity to convert CompanyDT DataTable to string. Let’s say CompanyNames.
-
And then use below expression to convert it to list.
LstCompany = CompanyNames.Split(Environment.NewLine.ToCharArray)
ListCompanyNames | List(Of String) =
dtData.AsEnumerable.Select(Function (x) x(YourColNameOrIndex).toString.trim).Distinct().toList