Need to write in different sheet based on industry type, format type.csv


Can you be more explicit, any expected output?



First read the data into dataatble…

Then newdt = dt.Defaultview.ToTable(True,{"Industry type"})

This will give you all unique industries in a newdt

Now loop through newdt and then inside loop use filter datatable to filter the main datatable dt with each industry type…

Using currentrow(0).Tostring

So gor each iteration you will have one industry type filtered. in the loop use the filtereddt and write csv activity


as per attached image, the csv file having different industry type. I need to save them in their individual sheets.


Hope the following sample helps you.

dict =dt.AsEnumerable.GroupBy(Function(r) r("Industry").ToString).ToDictionary(Function(g) g.Key,Function(g) g.CopyToDataTable) (3.2 KB)

Please replace data.csv with your input csv.


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