Copy Excel files from one Folder to another based in a list

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Jose.Pizarro
Junior Member
Junior Member
Posts: 2
Joined: 2022-09-29, 13:02 UTC

Copy Excel files from one Folder to another based in a list

Post by *Jose.Pizarro »

Hi Guys,

I want to to know if is possible Copy Excel files from one Folder to another based in a list.

For example I have several files in one location . But I have a list name of some files to be extracted from this location and to put in another location.

Location 1:

File1.xls
File2.xls
File3.xls
File4.xls
File5.xls


List of files I want to move :

File2.xls
File3.xls

Location 2: (expected location)

File2.xls
File3.xls
Last edited by Jose.Pizarro on 2022-09-29, 14:21 UTC, edited 1 time in total.
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Copy Excel files from one Folder to another based in a list

Post by *Gral »

"Background transfer manager" is what you are looking for.

mk:@MSITStore:TOTALCMD.CHM::/options_background_transfer_manager.htm
Jose.Pizarro
Junior Member
Junior Member
Posts: 2
Joined: 2022-09-29, 13:02 UTC

Re: Copy Excel files from one Folder to another based in a list

Post by *Jose.Pizarro »

Hi ,

I tried to use this function but I can select the specific files I want to move from one folder to another one.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

PowerShell: Copy files based on a list

Post by *Stefan2 »

Jose.Pizarro Hello and welcome to the forum.


FROM:
Location 1:
File1.xls
File2.xls
File3.xls
File4.xls
File5.xls

BASED on List.TXT (be sure the names match to the real names):
File2.xls
File  3.xls


TO:
Location 2: (expected location)
File2.xls
File3.xls




Try this:
- go in TC to your "Location 1"
- open Command prompt from Commands menu
- type powershell and enter
- use the below three commands:
Set-Location 'Location 1' (((used TAB completion)))
$TargetLoc = "D:\rive\full path\to\Location 2" (((folder must exist)))
Get-Content .\LIST.txt | ForEach-Object{ Copy-Item $_ $TargetLoc}




Example:
- Commands menu > Open Command prompt
- powershell <ENTER>
- PS C:\temp\Copy files from a list>
- PS C:\temp\Copy files from a list>CD '.\Location 1\'
- PS C:\temp\Copy files from a list\Location 1>$TargetLoc = "C:\temp\Copy files from a list\sub folder\Location 2\"
- PS C:\temp\Copy files from a list\Location 1>GC .\LIST.txt | ForEach{ COPY $_ $TargetLoc }
- PS C:\temp\Copy files from a list\Location 1>

Done




 
User avatar
white
Power Member
Power Member
Posts: 4596
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Copy Excel files from one Folder to another based in a list

Post by *white »

Jose.Pizarro wrote: 2022-09-29, 13:08 UTC I want to to know if is possible Copy Excel files from one Folder to another based in a list.

For example I have several files in one location . But I have a list name of some files to be extracted from this location and to put in another location.
You can use menu option Mark/Load Selection From File to select the files you want to copy.
You can also use the LOADLIST command (for example by creating a button) to load the files as search results and then copy them.

Is that helpful or do you want something else?
Post Reply