Forum Discussion

PatMyer's avatar
PatMyer
Copper Contributor
Jan 26, 2023

How to copy a file and rename based column contents

I have on C drive a file thats called BlankImage.jpg. 

Inside of excel in column A contains a list of parts, is there an automated way that the BlankImage file can be copied and renamed based on the contents of each cell.  

Column A 

001.001.00

002.001.00

003.001.00

004.001.00

 

    • PatMyer's avatar
      PatMyer
      Copper Contributor

      Patrick2788 

      It is not finding the file folder set up on desktop. Is it because we use OneDrive? I created a folder on my desktop to do a practice run named "Test" and copied the address to cell D1 as the example excel sheet indicated.

      When I pasted to Command Prompt
      U:\>cd C:\Users\pat.myer\OneDrive - A-dec Inc\Desktop\Test

      U:\>copy No Image.jpg 001.013.01.jpg
      The system cannot find the file specified.

      U:\>copy No Image.jpg 001.015.00.jpg
      The system cannot find the file specified.

      • Patrick2788's avatar
        Patrick2788
        Silver Contributor

        PatMyer 

        I believe it's the spaces in the file name. You'd have to adjust the syntax to be:
        copy "Document Test.txt" 001.txt

Resources