Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
Bulk renaming fotos from Name_Firstname to username
Last Post 17 Sep 2010 04:59 AM by
George Howarth
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
ziege
New Member
Posts:13
16 Sep 2010 10:46 PM
Hello experts,
our teachers take pictures of students at the beginning of the year. They probably name the fotos like firstname_name.jpg or maybe name.firstname.jpg. Different separators are thinkable: _ or - or .
I want to rename all the fotos in a bulk operation to the windows usernames. This usernames looks like this:
Simpso.Bartho.123456
in general: <6 characters_of_firstname>.<6 characters_of_surname>.
All usernames are available in a csv-file. Even the firstnames and surnames are availabe in that flatfile.
So the script has to read the fotos one by one, then do a kind of
vlookup
in csv and replace the name of the fotos.
Is that possible with ps?
muchas gracias
ziege
George Howarth
Basic Member
Posts:360
17 Sep 2010 04:59 AM
Can you give us an sample of what the CSV looks like?
Sounds pretty easy to do. All you would need to do is setup a hashtable and then rename accordingly as you loop through the image files.
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Active Directory
--Exchange Server
--Lync Server
--SharePoint
--SQL Server
--System Center
--Non-Microsoft Products
--Books, Tools, and Videos
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2