Does anyone know much about powershell?
I have about 3k files i want to edit the name of.. for example
90_12200.jpg
to
12200p.jpg
anyone know?
Does anyone know much about powershell?
I have about 3k files i want to edit the name of.. for example
90_12200.jpg
to
12200p.jpg
anyone know?
Generate some test files first:
0..4 | % { set-content 90_1220$_.jpg "" }
# Output
90_12200.jpg
90_12201.jpg
90_12202.jpg
90_12203.jpg
90_12204.jpg
Then list the files, pass to foreach and rename. $($_.BaseName.Replace("90_", "")+"p"+$_.Extension) will take the base name, remove 90_, add letter p and file's extension.
gci 90_*.jpg | % { Move-Item $_ $($_.BaseName.Replace("90_", "")+"p"+$_.Extension) }
gci
# Output
12200p.jpg
12201p.jpg
12202p.jpg
12203p.jpg
12204p.jpg