How to rename files from a list in another file

Hi All,

I would like to rename some files using an excel list with the old filename in one column and the new filename in another - So using the list as reference to read & write from.

There is a tutorial on Youtube showing exactly this but the version shown had ‘For Each Row’ activity whereas my Version (Trial) has ‘For each row in data table’ so the expressions do not work

Any suggestions on how to do this in Trial version would be great

When you read from the excel list, you store it as a data table Variable. Then you use the for each row on that data table.

Hi @Cameron_Pirrie ,

If the names are unique, then could you give this a try?

image

Converting Dataset into Dictionary

dt_sampleData.AsEnumerable().ToDictionary(Function(k) k(0).ToString, Function(v) v(1).ToString)

New file name->

dict_fileCollection(Path.GetFileNameWithoutExtension(file))

RenameFiles.xaml (9.1 KB)

Kind Regards,
Ashwin A.K

Thanks - That was very helpful.

Along with this video which shows how to read an excel file, store as a data table and then enter into a webform (instead of renaming a file) - I was able to achive my goal!

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