Batch To Find File, Copy File, then Rename File fr

2019-04-16 17:01发布

Goal: To obtain images with the same name as column B:

My Excel File

I currently have the images in column A stored locally as JPEGS. I also have an excel document with the files that need to be renamed. I want to:

  1. Copy Image from folder (ie. BEVBB48GSY1B.jpg)
  2. Rename File to next cell in the rows text (ie. BEV-BB48GSY1B.jpg)
  3. Automatically move on to the next Row to do the same (ie. BEVBB48GSY1B copied and renamed to BEV-BB48GSY1B27)

Any ideas on which programming I need to be using or where to start? Thanks in advance.

1条回答
霸刀☆藐视天下
2楼-- · 2019-04-16 17:43

A simple batch script should do.

@echo off

for /F "tokens=1,2 delims=," %%j in (your.csv) do (
    rename "path\to\images\%%j.jpg" %%k.jpg
)

It will print out an error for the first line of the CSV (which is actually the column header). Just ignore it.

查看更多
登录 后发表回答