Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7088595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:49:12+00:00 2026-05-28T07:49:12+00:00

My question is very similar to the question posted here on stackoverflow but the

  • 0

My question is very similar to the question posted here on stackoverflow but the difference for me is that I need the batch script to do the following

  1. Look at a csv file which has the name only without the image extension and find the image with that name in a particular directory
  2. Then take that file and copy it to another directory

What modifications would I need to do to this batch script to accomplish that task?

 @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 
 )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:49:13+00:00Added an answer on May 28, 2026 at 7:49 am

    The following Batch file assumes that the .CSV file contains just one field per line: the name, with NO extension, of a file that exist, with ANY extension, in a particular directory, so it copy that file to another directory.

    @echo off
    set "theDir=C:\The\Particular\Directory"
    for /F "delims=" %%f in (theFile.csv) do (
       copy %theDir%\%%f.* "C:\another\Directory"
    )
    

    If you want the image file have an extension taken from a limited list:

    @echo off
    set "theDir=C:\The\Particular\Directory"
    for /F "delims=" %%f in (theFile.csv) do (
       for %%e in (jpg png) do (
          if exist "%theDir%\%%f.%%e" copy "%theDir%\%%f.%%e" "C:\another\Directory"
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this question is very similar to the question posted here .
[I already posted something very similar but the question wasn't good, here is what
I've seen a very similar question was posted but his solution didn't help. I'm
I asked a very similar question here but since it is such a fundamental
I know there is a very similar question here but I was hoping to
I know the very similar question was posted here already ( How to change
[I posted a similar question on serverfault.com, but had very little feedback so trying
This question is very similar to that posed here . My problem is that
My question is very similar this but I guess I need to take it
There has already been a question posted here which is very similar. Mine is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.