0

I am facing a problem moving multiple files from different folders to one single folder.

All my files are ending with .las and are located in a path like this : e:\LiDAR\%%%%\LIDAR*\, where %%%% is a serie of 4 numbers like 0950, and where LiDAR* is the beggining of all the different folder names containing the .las files.

Here's an exemple of path of one of the .las file :

E:\LiDAR\0950\LIDARHD_1-0_LAZ_PK-0950_6535-2021\Semis_2021_0950_6535_LA93_IGN69.las

I want to move all those files to a folder I created, here is its path :

E:\LiDAR\Las_files

Here's the command line I tried but it's not working :

E:\>move e:\LiDAR\%%%%\LIDAR*\*.las e:\LiDAR\Las_files\

I would be happy if someone can help me : )

1
  • Are you literally using the %%%% in your command, or are you trying this with a specific number first? Sep 19, 2022 at 10:15

2 Answers 2

0

Try this in Powershell:

Get-ChildItem -Path "E:\LiDAR" -Filter *.las -Recurse | Move-Item -Destination "E:\LiDAR\Las_files" -Whatif

This should move every .las file from all sub-folders into the las_files folder.

0

Your attempt would have worked in Bash, but Cmd.exe has no "generic" wildcard processing (it's done on a case-by-case basis, with move and del doing it differently), so instead you'll need to use for and loop through each directory:

for /d %x in (e:\lidar\####\lidar*) do move %x\*.las e:\lidar\las_files\

(Note that if you put this in a .bat/.cmd script, the %x must be written as %%x.)

If you need to loop through numbered directories, you'll need a second (outer) for loop for that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .