Interchanging names

I have a column of names in (lastname, Firstname) format which is to be dumped into another excel sheet in the format of FirstnameLastname.

1 Like

Buddy @learie
Kindly follow the below steps to get your issue resolved

  1. open excel application scope
  2. use read range to read the data in excel with output variable of type out_dt with add headers unchecked
  3. For each row loop with out_dt as input
  4. two assign activity with
    column_1_value = row(0)
    column_2_value = row(1)
    5.use write cell activity with cell value as “A”+counter_1.Tostring
    and another write cell activity with cell value as “B”+counter2.Tostring
    increment this counter_1 and counter_2 from initial value 1 with
    counter_1+1 and counter_2 + 1

Cheers

1 Like

Thank you very much Sir…I will try this and get back to you

1 Like

Actually the Full names right now exists as a single string in a single cell down a column

hii
@learie
Check this sample workflow and change things according your requirements.ChangeColumns.xaml (7.6 KB)
Regards,
Monika

1 Like

read 1st and last name then use write activity and then 1st + 2nd name it should be working for you

Thank you for your reply. I actually wanted to interchange the position of name in the same column. Will you be able to help me with that

I’m sorry but i want to change the position of the full name from Lastname,Firstname to Firstname lastname

Buddy can you kindly come again with the requirments, may be i hope i didnt understand…don’t mistake,just to clarify

Cheers

Ok… I have a set of names in a column in an excel sheet in the format Lastname, Firstname.
Now, I want to copy these names to another sheet by changing the format to FirstnameLastname

So you want the order to be changed right…? like it was lastname, firstname
now you want to be in firstname, lastname

am i right buddy @learie

do it as 2nd + 1st name buddy

i will share a sample workflow wait

just for confirmation from excel you are reading 1st and 2nd name
now you want that to print on excel as 2nd and 1st name together i am correct ?

yes exactly…

Thank you very much… it is already existing together as a string…I just want to change the order of the name to FirstnameLastname

great here is your procedure buddy @learie

  1. open excel appication scope
  2. use read range activity with output out_dt
  3. use a build datatable with headers like FirstName and LastName both in string format and name the datatable as final_dt
  4. use a clear datatable activity and pass the input as final_dt
  5. use a for each row loop buddy with two assign activitties in it.
  6. pass out_dt as input to for each row loop buddy
  7. for first assign activity
    final_dt.Rows(out_dt.Rows.Indexof(row))(1) = row(“LastName”).ToString
    and second assign activity with
    final_dt.Rows(out_dt.Rows.Indexof(row))(0) = row(“FirstName”).ToString
  8. Then outside this for each row loop use a write range workbook activity and mention the path of the excel file you want to enter with this data and pass the datatable input as final_dt
    9 Thats all buddy you are all done

Cheers

1 Like

Thank you very much

Kindly let know whether this works buddy

Cheers

yes…i will get back to you once this is done. once again thank you

1 Like

is that working buddy @learie

Cheers

Hii… It is working .Thank you very much

1 Like