Merging Two Columns in a CSV File

In a CSV file there are columns called first-name and last-name.
I want to Merge the above columns into one column called Full Name

Ex: The Column first-name has Aaaa and Column last-name has Bbbb
Then merge them into one - Full Name and it must be Aaaa Bbbb

Thanks in Advance!

1 Like

Hi
hope these steps would help you resolve this
–use a READ CSV FILE activity and pass the csv filepath as input and get the output with a variable of type datatable named dt
–now use a INVOKE METHOD activity and mention target object as
dt.Columns.Add(“Fullname”)
and inthe method mention as SetOrdinal
and in the parameter property mention as 0

–then use a FOR EACH ROW activity and mention the input as dt and inside the loop use a assign activity liket his
row(“Fullname”) = row(“first-name”).tostring+" "+row(“last-name”).Tostring

–next to this FOR EACH ROW use remove datacolumn activity and mention the columnname as “first-name”
again another one activity with column name as “last-name”

–now use a WRITE CSV file activity and pass the variable dt as input

Cheers @ray_sha

1 Like

Hi @Palaniyappan/@ray_sha

U can do add data column activity

Thanks
Ashwin S

Hey @Palaniyappan @AshwinS2

I used Add Data Column Activity and then as @Palaniyappan guided used the code
row(“Fullname”) = row(“first-name”).tostring+" "+row(“last-name”).Tostring

works well!
Thanks Guys!

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