how to move files download folder to document folder. the file name starting with “Undefined”. it was csv files. kindly share workflow
Check the below steps,
→ Use the For each file in folder activity to iterate the each file in the Downloads folder.
→ In the filter by field give “*.csv” to filter out the Csv files.
→ Inside for each insert an If condition to check the file name, give the condition as below,
CurrentFile.Name.StartsWith("Undefined")
→ Inside then block insert the Move file activity to move the specified file to the documents folder.
Check the below image for better understanding,
Hope it helps!!
its not working share another method
Use the below syntaxes in Assign activities:
sourceFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\Downloads"
destinationFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
csvFiles = Directory.GetFiles(sourceFolder).Where(Function(f) Path.GetFileName(f).StartsWith("Undefined") AndAlso Path.GetExtension(f).Equals(".csv")).ToArray()
For Each currentText in csvFiles
Move File Activity
From -> currentText
To -> Path.Combine(destinationFolder, Path.GetFileName(currentText))
Next
FLOW:
VARIABLE DATATYPE:
XAML:
Sequence14.xaml (9.4 KB)
Hope it helps!!
so for this you can use for each file in a folder activity and inside this use move file activity …
this 2 things will get the files from the folder and move to desired folder path .
cheers Happy Automation…
cheers Happy Automation.
first its working, next its not working.
If it works for first time it will work from the next time as well… @domsmgtmeet22
Might be you are missing something here. In first time all files are moved then they will be no files for the next time.
If you are getting any error, attach the screenshot of the output panel here then we can easily understand.
Hope you understand!!
Yes @domsmgtmeet22
The file is already moved in the First run, in the next run it was searching for the same file in the folder and failed.
Can you show me your workflow what you done.
@domsmgtmeet22 you can do one thing first you can check with the file Exists Activity so it will check the file is present on that location or not then use the move activity.
cheers