Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

Celebration

(15,812 posts)
Mon Mar 3, 2014, 09:29 PM Mar 2014

copying and pasting same file over and over

I won't go into why I want to do this, because the explanation would be long and off topic, but basically what I want to do is the following:

Take a picture, small file size probably in png format (i can do that)

Taking it from my computer, putting it onto a thumb drive (I can do that)

Copying and pasting that same picture over and over again, on the same thumb drive, so that I have thousands of the same file on the thumb drive, all. To do that, I could first copy and paste one, then copy and paste those two, then copy and paste four, etc. until I fill up the thumb drive.

My issue is this--this automatically adds extensions onto the name of the file, so that none of the files are named the same thing, but have various numbers after them. After I do this just a few times, the names of the files get too long. It just doesn't work well, because the long names put a monkey wrench into the whole thing

Yes I know I could rename all the files to something shorter, but that would take literally forever.

I don't really care about the names of the files, I just want them to be a. short, and b. automatically named

Is there any easy way to do this? Thanks so much.

6 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
copying and pasting same file over and over (Original Post) Celebration Mar 2014 OP
Try naming the file "10.ext" TygrBright Mar 2014 #1
Assuming a recent Windows OS, ManiacJoe Mar 2014 #2
You could use the batch rename function in IrfanView. Make7 Mar 2014 #3
Try this...(assuming Windows 7 or greater) ChromeFoundry Mar 2014 #4
Oops - I see this was already posted A Little Weird Mar 2014 #5
Thanks to ALL of you!! Celebration Mar 2014 #6

TygrBright

(20,763 posts)
1. Try naming the file "10.ext"
Mon Mar 3, 2014, 10:12 PM
Mar 2014

Where "ext" is the file type.

You will get 10(1).ext, 10(2).ext, etc.

You'll still get up to (XXXXX) the number of the copies, but it will be a shorter format?

helpfully,
Bright

ManiacJoe

(10,136 posts)
2. Assuming a recent Windows OS,
Mon Mar 3, 2014, 10:15 PM
Mar 2014

try something like the following in a CMD or BAT file:

SETLOCAL ENABLEEXTENSIONS
FOR /L %%x IN (1,1,1000) DO copy c:\tmp\a.gif k:\pics\a_%%x.gif
ENDLOCAL

This will result in 1000 copies of the file onto your K: drive with file names like a_1.gif, a_2.gif, ..., a_999.gif, a_1000.gif

Make7

(8,543 posts)
3. You could use the batch rename function in IrfanView.
Mon Mar 3, 2014, 10:18 PM
Mar 2014

Make a source folder with ten or twenty copies of the image file and send the renamed files to a destination folder (probably on the thumb drive - be sure to check the Remeber last rename counter box in the options - and then hit the Start batch, then Return to batch buttons until your arm falls off.

You could use the batch conversion process to get a source folder with hundreds of copies to lessen the number of times you need to hit the Start batch/Return to batch buttons.

ChromeFoundry

(3,270 posts)
4. Try this...(assuming Windows 7 or greater)
Mon Mar 3, 2014, 10:29 PM
Mar 2014

Start => type "Powershell.exe"; Click the item in the returned list.
A console window will appear.

Type the drive letter of your thumb drive followed by a colon and press enter => H:
Your prompt should now so that you are in thumb drive drive.

Assuming your PNG file is named "abc.png" in the root folder of the H: drive...type the following command at the prompt...
Get-Item "abc.png" | %{ for ($i=1; $i -le 1000; $i++) { Copy-Item $_ "$i$($_.Extension)" } }

Replace "abc.png" with the actual filename. Replace 1000 with the number of copies you want to make.
You will end up with 1000 copies of the file named 1.png to 1000.png in the same folder.

Note: Most file systems will limit the number of files to 65535 files per folder.

Hope this helps.

A Little Weird

(1,754 posts)
5. Oops - I see this was already posted
Mon Mar 3, 2014, 10:34 PM
Mar 2014

I'll leave it up just because I find it useful to see multiple examples.




If you start with this file c:\temp\1textfile.txt

-Go to the comand prompt and navigate to c:\temp

-type in the following:
for /L %f in (1,1,1000) do copy C:\Temp\1textfile.txt C:\Temp\%ftextfile.txt

It should give you 1000 copies of your text file with ascending numbers at the front (2textfile.txt, 3textfile.txt, etc). I don't know how you know how many files it would take to fill up the drive but you could probably just use trial and error for that.

Celebration

(15,812 posts)
6. Thanks to ALL of you!!
Mon Mar 3, 2014, 10:35 PM
Mar 2014

Going to get into geek mode tomorrow and see if I can make this happen, with one of the above ways.

Latest Discussions»Help & Search»Computer Help and Support»copying and pasting same ...