How can i move all .txt from a folder to another?

Hi there,

i have a process that needs do move all .txt from one folder to another.
First i was deleting and it was ok but now i can’t delete them… i have to keep them in a folder.
How can i do that?

@ac_couto6

strTxtFiles [ ] = Directory.GetFiles(“Folder Path”, “*.txt”) - It will give array of text files.

Use For Each loop to iterate that array and then use Move File activity to move file to destination.

1 Like

Hi @ac_couto6,
Welcome to the Community!
You can achieve this in many ways. By simple invoke of PowerShell script or any other code. The simplest way I think is just make a process which will navigate to the folder, then will sent hotkey “ctrl+a”, “ctrl+x” and finally navigate to the second folder and do “ctrl+v” :wink:

2 Likes

Buddy @ac_couto6

Kindly refer the below xaml that could help you to resolve the issue

movefiles.xaml (6.5 KB)

Hope this would help you
Cheers buddy

3 Likes

one liner code to achieve the same would be Invoke Power Shell
with command text "Move-Item C:\Temp\*.txt C:\temp2" and IsScript property checked

3 Likes
  1. Use strTxtFiles [ ] = Directory.GetFiles(“Folder Path”, “*.txt”) that will store txt file as array.
  2. Iterate through array of txt file and use move file activity to move file from one folder to other folder.

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