Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Split filename and create folders with Powershell script (

$
0
0

I have a folder with 1000's of files. Each file varies in length; typically between 9-14 characters. Example:

  • C:\workpics\1238955678.1
  • C:\workpics\744556224.1
  • C:\workpics\744556224.2
  • C:\workpics\8445655996.1

I would like to run a script to split the filename and separate into folders. The filename would then consist of 5 characters, the foldername would be the first characters remaining.

  • C:\workpics\12389\55678.1
  • C:\workpics\7445\56224.1
  • C:\workpics\7445\56224.2
  • C:\workpics\84456\55996.1

Any assistance to create this Powershell script would be awesome. Thank you!!


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>