Moving files in bulk to folders according to a key word in the file and folder name

109 Views Asked by At

I have several files named like this: Name 39W04150167 7015 0640 0000 2087 5834

I have several folders named like this: 39W04150167

I would like to transfer all files to their respective folders. The folder names and matching key word in the file names are unique and do not repeat.

Any ideas?

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

Assuming your OS is in the unix family,

$ mv 39W04150167[0-9]* 39W04150167