How to rename a folder during runtime

studio

#1

I have one value in excel…during run time i have to create a new folder and rename that folder with the value which i got from the excel cell.


#2

Hello!

You just have to loop through the Excel file and use the “Create Directory” activity to create the folder with the value of the excel assigned to a variable.

Something like this:

image
image

Hope it Helps!

Regards,


#3

I think this can be achieved by 4 steps:

  1. Create a 1st folder using Create directory.
  2. Create 2nd folder using Create directory with the excel value as the name.
  3. Move the files from folder 1 to 2.
  4. Delete the folder 1.

#4

Hi,
this procedure is not working bro in my system…


#5

Use below method in Invoke Method Activity

System.IO.Directory.Move

Reference Link

image


#6

@akhi_s27,

thank you bro


#7

Thanks @Lucas.Pimenta :slightly_smiling_face:
its working


#8

Hi @Lucas.Pimenta
In excel sheet…I have to move column E to before column C…Means insert cut cells operation…
I have to cut column E and at column C i have to do insert cut cells.
i done that using recording…but it is working sometimes and sometimes it is taking another column…is any other alternative method for doing this.


#9

Hey @Ananthaeswar2

For new question please prefer to create new thread

You can Use Excel Application Scope activity to get data from excel into a Datatable and then by using Setordinal() method you can change the columns order.

Like for yours:
dataTable.Columns[“E”].SetOrdinal(2);
dataTable.Columns[“C”].SetOrdinal(3);

Note- For Sample Workflow search on forum you will find plenty of resources here on this :slight_smile:

Regards…!!
Aksh


#10

Thank @aksh1yadav for the solution :slightly_smiling_face:
I posted that question in new thread only.but i didn’t get any reply for that.That y again i asked that question.
i didn’t find any samples regarding that…i m attaching one sample sheet. could you please help me with that.
Regards
Ananthasample.xlsx (7.8 KB)


#11

SetOrdinal_Sample.xaml (7.6 KB)
In above sample i am changing the ordinal of gender column so it will appear before age column

Regards…!!
Aksh