I want to change the file extension of multiple files which are available in one folder

i am having multiple file in txt format i want to change it into .pdf format
i have assigned file with directory.getfile(path, “*.pdf”)
and also applied for each activity to read it now i want to change the extension of all those file from “.txt” to “.pdf”.
Please let me know how can i do it.

Hi @office_work

For each Directory.GetFiles("YourFolderPath", "*.txt")
    Path.ChangeExtension(file, ".pdf"))

Hope it helps!!

It is not changing my “.txt” file to “.pdf” format

Hi @office_work
Install UiPath.Word.Activities Package

In for each
Directory.GetFiles("FolderPath", "*.txt")

In the Save document as pdf activity
Path.GetFileNameWithoutExtension(currentItem)+".pdf"

Hope it helps!!

@office_work

I made changes in the solution for the file name.

Regards

Main.xaml (23.8 KB)

This is my flow please correct me if i am wrong somewhere

Regards

@office_work

Yes, you are correct

but Process is not working as per the requirement.