How To Write A Particular Column into a Different Column

Hi All,

After I read a column, how can I write it to a different Column?

Thanks & Reagrds,

1 Like

Hi @caoshixiao

use write cell activity and mention the path and range as “A”
use add data column and mention the value for the column in column property and then use write range activity

Ashwin S

using a assign activity
and mention like this which will convert the column values toa list variable
List(of string) listvar = (From row in dt.AsEnumerable() Select Convert.Tostring(row(“ColumnName”))).ToList()

now use a WHILE loop with condition like this
counter < listvar.Count
where counter is a variable of type int32 with default value as 0 defined in the variable panel
–inside the loop use a assign activity and mention like this
datatable.Rows(counter)(“yourcolumnname”) = list(counter).ToString
–next to this use another assign activity like this
counter = counter + 1

Cheers @caoshixiao

Put all the values of a particular column to a array using below code,
Assign items = dt1.AsEnumerable.Select(Function® r(“ColumnName”).ToString.Trim).ToArray
then send that array in for each to update a datatable of different column name.

Hi @caoshixiao

You can use readrange activity and after that you can use write range activity if you want to update some column in your datatable and do the write range for the excel.

cheers :smiley:

Happy learning :smiley:

1 Like

Check this workflow,
Test_Sequence.xaml (10.8 KB)