Batch copy files, csv specific

Medion / N/A
January 13, 2009 at 08:30:17
Specs: Windows Vista, 3 GHz, 2 GB
Hi,

I have a csv file that looks like this:

"Path","Hash","othercolumns"
...

I'd like to write a batch file to execute the following copy command with each line specified in the CSV:

copy Path Target\Hash.Extension

Path is the first column of the CSV that contains the full file path including extension. Hash is the second column in CSV and should be the new filename.

Is that possible with a batch file or should I better to with a small self made program?


Regards,

Emsi


See More: Batch copy files, csv specific

Report •


#1
January 13, 2009 at 09:52:11
for /f "tokens=1,2* delims=," %a in (csv) do @echo copy %a "%~fa\%~b%~xa"

type in command prompt, remove echo when the code suit you.


Report •

#2
January 13, 2009 at 10:54:37
Thanks a lot! Powerful batch. :)


Regards,

Emsi


Report •

Related Solutions


Ask Question