Jump to content

Copy 1 file multiple times taking name from csv or similar?


Recommended Posts

Posted

Hi,

 

Been asked to create a copy of one file for every student renaming the file to their name.

 

Gotta do this for multiple files and dont like the though of spending hours copying and pasting names and then do it again next year.

 

Has anyone got a CMD script using robocopy or similar?

 

 

If not, think im gonna need a FOR, Robocopy and an awake mind to work it out.

 

Thanks.

Posted

Something like this should do it.

@echo off for /f "tokens=1,2 delims=," %%j in (project.csv) do ( copy "%%j.jpg" c:\mytestproject\newimages rename "c:\mytestproject\newimages\%%j.jpg" %%k.jpg )

  • Thanks 2
Posted
Something like this should do it.

@echo off for /f "tokens=1,2 delims=," %%j in (project.csv) do ( copy "%%j.jpg" c:\mytestproject\newimages rename "c:\mytestproject\newimages\%%j.jpg" %%k.jpg )

 

Thanks,

 

SLightly edited for a single file but posting here so i can find again in the future :)

 

for /f "tokens=1 delims=," %%j in (C:\Users\***\Documents\PIES\studentlist.csv) do ( copy "C:\Users\***\Documents\PIES\PIES MASTER.xlsx" "C:\Users\***\Documents\PIES\PIES %%j.xlsx" )

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...