How to rename text file form downloaded and move that file in specific share path
Thanks
How to rename text file form downloaded and move that file in specific share path
Thanks
You can either enable the “Ask where to save each file before downloading” in chrome settings then change the name and location during automation
or
After downloaded the file change the name by “rename file” activity by providing the downloaded file path.
You can move the file to specific path using move file activity.
Regards,
Just use Move activity to move the file to the desired folder location and add the new name in the TO
Regards
Gokul
If you don’t want to change the chrome settings to ask everytime where to download,
you can use Wait for Download activity. and get the filepath from there.
Later use a Move File activity, and you can rename it then and there.
Thanks
Hi @suraj_gaikwad
Try like this
In this image I want to move that file only whenever bot will run move only recently file download
@suraj_gaikwad
Try this
Directory.GetFiles(downloadDir, filename+“*.pdf”).OrderByDescending(Function(f) new FileInfo(f).CreationTime )(0)
This expression will get the Latest file in the download folder
Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads").[Select](Function(x) New FileInfo(x)).Where(Function(f) f.Extension.Equals(".txt")).OrderByDescending(Function(x) x.LastWriteTime).Take(1).ToArray()(0).ToString
Regards
Gokul
You can use for each file for iterating and find the latest downloaded file.
Regards,
Hey @suraj_gaikwad ,
Please use this to get the Latest downloaded Text file
Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads").[Select](Function(x) New FileInfo(x)).Where(Function(f) f.Extension.Equals(".txt")).OrderByDescending(Function(x) x.LastWriteTime).Take(1).ToArray()(0).ToString
Now you can Move that particular file using “Move File” Activity
and Rename it using “Rename File” Activity
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.