Copy column values between same DT without looping

I want to copy the column values between two columns in same datatable without Loop

Let say,

DT1 has three columns(ref below), i wanna copy the column values from Addrs to Name Column without using loop.

|Name|Age|Addrs|
| |2 |ABC|
| |3 |DEF|

Hi @Manikandasamy

Please have a look at the thread

Thanks.

I checked that, in the work flow its copying the value from another DT. Its making a clone of DT1 and from there its merging. Am having more data to process.

I need to copy the column values between same DT.

1 Like

Hi @Manikandasamy ,

Maybe you Could Provide us with a bit more explanation as to How you would need the Output ?

If you want to Simply Copy some Columns from one datatable to another datatable, you could use the Below :
Create a new Datatable, say newDT. Then use the Expression below :

newDT = DT.DefaultView.ToTable(false,"Name","Age","Addrs")

Where DT is your Datatable variable from which you want to copy the columns data.

@Manikandasamy You want to copy the column values from Name to Addrs or Addrs to Name ? and where you want to store these copied values, is it in a different data table ?

Easiest way in my opinion is:

  1. Remove column “Name”
  2. Duplicate column “Addrs”
  3. Rename duplicated column to “Name”
1 Like

use copy paste range activity

Hello @Manikandasamy

You can do as below.
1)Use Excel activity
2)Find First/Last Row activity
3)Copy/Paste Range activity


image

Hey @Manikandasamy

Kindly try the below,

  1. Apply default view and create a new table copy with only Address column

  2. Joine these two tables using inner join

  3. Delete the old name column and rename the newly added address column to name

Hope this helps

Thanks
#nK

1 Like

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