Move CSV file from download folder to another folder

Hi Folks,

Please help me with this issue, from download folder I want to move CSV file to the another folder.

Note: This is the file CSV name “Export-Shelfwise Inventory-_15112023154313” and in the file name you can see numeric number “15112023154313” this will change randomly on daily basis. common name is “Export-Shelfwise Inventory-”. based on common name I want to select the file and move to the another folder.

Can anyone pls help me on this issue.

Thanks in advance

@Vijay_R1

directory.GetFiles("C:\Users\cogni\Downloads","Export-Shelfwise Inventory-_*.csv").toarray

can you try this once gives you output as array of string

below it use for each activity inside use move file activity

1 Like

Hi @Vijay_R1

This code will give you the path of the latest CSV file in the specified folder. Use it in a assign activity. Replace your folder path variable with yourfolder_path variable

str_filepath = Directory.GetFiles(yourfolder_path, “*.csv”) _
.OrderByDescending(Function(d) New FileInfo(d).CreationTime) _
.FirstOrDefault()

1 Like

Hi

You can use the For Each File in Folder Activity and provide the filter Export-Shelfwise Inventory-_*.csv:

1 Like

@Vijay_R1
you can achieve this task using the “Assign” activity,
“Directory.GetFiles” method, and “Move File” activity.

1 Like

Hey @rikulsilva,

Thanks a lot, it works :slight_smile:

Hi @Shiva_Nikhil , I got the result thanks a lot :slight_smile:

1 Like

Hey @AJ_Ask thanks a lot I got the result :slight_smile:

Hey @Krishna_Raj Thanks a lot I got the result :slight_smile:

1 Like

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