I want create a flow for below things.
In a particular folder lot of files will be stored. I want to select the recently added files(.XLS) then open that file and change the file formats from .XLS to .XLSX and rename the file name for current date and time.
Can some one help me on this. And give some examples
In the above case all he can do is the following:-
- Open (.xls) file.
- Use shortcut keys to get to the “Save as” file window
- Type the file path along with the file name.
Note:- When we use the shortcut keys to reach the “Save As” window, you can naturally see the “file type” to be [Excel] Workbook , which means (.xlsx) file.
To give the string name, you can use the date time stamp to save with unique name.
Thanks. I want run this flow for daily. Can you please give some examples or flows.
How to create a flow
If you are asking about Step 2, shortcut keys, you can simply try to use these shortcut keys manually and note them down.
In my system, following sequence works best, note below images for reference:-
Step 1 -> When the excel is open, to go to files (sendhotkey (ALT + F))
Step 2 -> to export, (sendhotkey (ALT + E))
Step 3 -> to Change file type, (sendhotkey (ALT + C))
Step 4 -> to go to Workbook option, (sendhotkey (ALT + Q))
Step 5 -> to click on the Workbook option, (sendhotkey (enter))
This is very loud and clear, hope it clears your doubts. You get the window to put your filepath and filename.
Mark as solution if this helps.
Thanks and Regards,
Thanks. How to open the recently added files from particular folder.
Which activity i need to use for to open the files.
DateTime.Today will give you current date and time store it in a variable.
take a string array = Directory.GetFiles(“path of directory”)
Use for each loop to get all files from a directory and then use-
It will give you creation datetime for each file available in the path.
Then to get recently added file you can compare creation date time with current date time.
You can store all creation datetime in a datatable and then sort it in descending order and then take first value.
You can easily replace in command line
go to command prompt
cd “your path”
rename *.xls *.xlsx
same way you can design a flow in studio
Take a look this package from UiPath Go to convert the file format.
Thanks for your response.
Could you please create a flow for me.
@vivek_sivam - share your email address, I will try to send the workflow…
In my case file have the xls format but inside the file it have html content so i can’t able to convert automate process. It is possible to open the particular folder and took the recently uploaded file then convert in to .xlsx file.
Can you please create a flow for this
My email: firstname.lastname@example.org
Use the below code to get the recent file in the folder
myFile = new DirectoryInfo(<yourFolderPath>).GetFiles().OrderByDescending(f => f.LastWriteTime).First();