Friday, 29 March 2019

Using split in powershell to get remove part of the filename



In order to change filenames in bulk using string you can use split switch to filter out first part of the file name.
For example, when I need to cut of "car" part of the file name, then I can use

get-childitem|%{$newname=$_.name -split ("car")|select -Last 1;Rename-Item $_.name -NewName $newname}



1 comment:

  1. We suppose that the procedure is not time consuming and we will be successfully end it as soon as possible. Let me just give it a first try.

    ReplyDelete