How to convert comma values & write the same in each row?

Hi Team

I have struggling to make an automation converts this comma separated values & write the same in each row - Eggs, Milk, Bread, Butter.


Expected output -

Please help me with the steps or activities required to make this.

Regards
Naman

Hi @Naman_Arora

Assign ---- itemsArray = inputString.Split(","c)

For Each activity (TypeArgument: String):

Inside the loop, use Write Cell:

Write Cell: “A” & (Array.IndexOf(itemsArray, item) + 2).ToString
Value: item.Trim()

Happy Automation.

Hi @Naman_Arora

=> Use Build DateTable to create the column names


=> Read the text file and store it in a variable say str_Text.
=> Use the below LINQ to convert it to datatable
dt = str_Text.Split(","c).Select(Function(item) dt.Rows.Add(item.Trim())).CopyToDataTable()
=> Use Write Range Workbook to write the data to excel.

Check the below workflow for better understanding:
Sequence10.xaml (10.6 KB)

Hope it helps!!

Hie @Naman_Arora here is the method create one array of string variable and pass the value use 1 for each inside for each use write cell and increament the cell with currentindex variable


Sequence1.xaml (9.2 KB)
am attaching zip file and screenshot

cheers