![]() |
|
![]() | ||
|
Subject:
How can I paste multiple files with identical names in XP?
Category: Computers > Operating Systems Asked by: rexregum-ga List Price: $15.00 |
Posted:
11 Jun 2004 09:06 PDT
Expires: 11 Jul 2004 09:06 PDT Question ID: 359712 |
How can I paste multiple files with identical names in XP? The situation is thus: I have a large number of jpg images in the Temporary Internet Files folder, all of which are named 'webcam.jpg'. I cannot easily work with them while they are in this folder, as it is hidden from most applications. I therefore want copy the files to another, normal directory. The problem is, windows explorer will not paste all of them; I get the 'Do you want to replace the existing file...with this one...?' dialogue box. If I take 'yes' , each file replaces the one before and I lose all but one of them. If I take 'no', one of two things happens: 1. The next file is pasted, with a new name, eg webcam[2].jpg . This happens about 20% of the time. 2. The file is not pasted at all; it is skipped over. This happens about 80% of the time. Then the box comes up again until all are accounted for. I am dealing with ~100 files at a time, so renaming them all myself is out of the question. How can I make sure that all the files are pasted in one go? | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 11 Jun 2004 19:23 PDT |
I'm one to use AWK95.exe for these things, so it's important to get it from the net (it's free) and put it in your path (c:\windows is good). One of the cool things about awk is that you only need one file to do so much... This program assumes a LOT of defaults (your systemdrive and cache are on the same drive, the cache is in a somewhat "normal" place). You need to change the P:\\ath\\to\\destination\\\\ appropriately, and make sure to double slashes with four! slashes at the end of the path. It assumes that there is one level deep of directories (most likely case). It assumes that assigning webcam.jpg to directoryname.jpg is an easy enough way to name the files. If you'd like another naming scheme, let me know. This is the code you should use in the uberbat.bat: -=-=-=- BEGIN uberbat.bat -=-=-=-=- @echo off %SYSTEMDRIVE% REM if appropriate, change .IE5 to .IE6 cd %USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5 dir /ad /b > dirlist.txt set dest=P:\\ath\\to\\destination\\\\ rem change webcam.jpg to folder.jpg set awk="{print(\"copy \" $1 \"\\webcam.jpg %dest%\" $1 \".jpg\")}" del dothis.bat awk95 %awk% dirlist.txt > dothis.bat set awk= ECHO check dothis.bat to make sure you like it. echo if you do like it, then remove the REM from the next line echo or just run dothis.bat manually. REM dothis.bat -=-=-=-=-=-END uberbat.bat-=-=-=-=- Please reply and let me know your success or failure with this. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 12 Jun 2004 07:55 PDT |
Hey rexregum, it's no problem to me if you don't like DOS. The program as suggested will work fine if you just double-click it (if you have awk95.exe), even if it's on the desktop. If you give me the destination location (where you want the files to go, where exactly they come from (the path to your IE cache)), I'll change it for you. Regardless, I feel someone else might find it interesting in a search. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rainbow-ga on 12 Jun 2004 14:38 PDT |
Hi rexregum, Unfortunately the files in the Temporary Internet Files folder cannot be renamed. Regards, Rainbow |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 13 Jun 2004 01:19 PDT |
I think I understand what you want to do, crythias. I have noticed that sometimes the files pasted end up with different names of the form CD3FH6EY, that is, 2 letters, a number, 2 letters, a number and 2 final letters. It appears that the files are each being pasted from different folders, each with a different name, and the files are acquiring the names of their folders. I suppose the Temporary Internet Files folder doesn't actually exist per se. If this can happen in explorer, there might be a way of forcing it to happen in explorer. Any ideas along these lines? I have tried, so far unsuccessfully, to get awk95 to work. I assumed that the thing to do with your code was to copy to a text file and rename it uberbat.bat; I hope that this is correct. When I run this in desktop, I get a list of the folders, one level deep, on the desktop, in the dirlist.txt file. Where exactly do I need to place the file for it to run correctly? If it helps you, the folder I would like the images to be placed in has the path C:\Documents and Settings\Angharad Miller\Local Settings\Webcam |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 13 Jun 2004 01:28 PDT |
I haven't managed to get it to paste any files yet. I placed a file called webcam.jpg in on of the folders listed in dirlist.txt, created a new folder for it to be copied to, and set the path to the new folder, but nothing happened when I ran dothis.bat. I'll keep trying... |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 13 Jun 2004 10:34 PDT |
dirlist.txt is a list of folders located in C:\Documents and Settings\Angharad Miller\Local Settings\Temporary Internet Folders\Content.IE5 you may have problems with the code copying to a destination with spaces in the destination name. I think I can fix that with the changes here. @echo off C: REM if appropriate, change .IE5 to .IE6 REM change here was to add quotes before and after cd "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5" dir /ad /b > dirlist.txt REM If the next line splits, combine them set dest=c:\\Documentss and settings\\Angharad Miller\\Local Settings\\webcam\\\\ rem change webcam.jpg to folder.jpg rem \042 adds quotation mark set awk="{print(\"copy \" $1 \"\\webcam.jpg \042%dest%\" $1 \".jpg\042\")}" del dothis.bat awk95 %awk% dirlist.txt > dothis.bat set awk= ECHO check dothis.bat to make sure you like it. echo if you do like it, then remove the REM from the next line echo or just run dothis.bat manually. REM dothis.bat PS: There is a simple registry hack that can be used to allow you to right-click on the Content.IE5 (actually, any) folder and run this program, although a simple double-click should do the job. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 13 Jun 2004 10:36 PDT |
sorry about the double S in documentss. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 14 Jun 2004 11:50 PDT |
I think I'm getting closer now. I had some difficulty finding the content.ie5 folder [it doesn't show even with hidden/protected files visible] but I got there in the end. In dothis.bat I now get a list of files appearing, which are from the correct folders, but they aren't copied to the target folder when I run it. I made a simpler folder ( c:\Webcam ) and tried that, but still no success. Why won't the files appear in the target folder? |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: pafalafa-ga on 14 Jun 2004 12:56 PDT |
PS -- I added a comment today, up above, but in case you didn't see it, here it is again: rexregum-ga, I'm a bit reluctant to throw my 2 cents in the mix here, what with all the advice you've gotten already, but... Can't you just create a new, empty folder, and bulk copy the files from the Temporary Internet Files folder into the new folder, using windows explorer? When I tried this with my XP system for files with identical names, they copied just fine into the new folder, but with a number appended: testfile[1] testfile[2] etc. If I understand correctly, this is the output you want, yes...? Good luck. pafalafa-ga |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 14 Jun 2004 14:09 PDT |
It's probably because you're running dothis.bat separately. Remove the "REM " from "REM dothis.bat" at the end of the uberbat and let the program run dothis.bat on its own. (This is the most likely cause of the frustration because dothis.bat runs a copy from relative path to absolute path and running dothis.bat separately won't (may not) ever work from desktop. It will work from a dos prompt at content.ie5.) I had added the review step to make sure you files at the destination weren't overwritten, because this is pretty much an "all or nothing" type thing. This also doesn't check if the file actually exists at the subfolder, or the destination folder is spelled correctly. It is pretty much brute force "copy it if it exists" type thing. The problem I have been experiencing here with providing code is that GA cuts off long lines, so I have to think around linewraps when coding. Otherwise I would have included absolute pathnames in the creation of the set awk= line. I apologize for the inconvenience you have experienced and thank you for the time you've already spent. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 14 Jun 2004 22:59 PDT |
Are the pathnames case sensitive? |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 15 Jun 2004 08:56 PDT |
rexregum-ga, At 22:36 PDT, you wrote Clarification of Question by rexregum-ga on 14 Jun 2004 22:36 PDT I think what could be causing the problem is that the files have a timestamp in the filename, after the file extension, which is about 12 digits long. Only the last digit changes between each file and the next. Thanks for your assistance anyway... -=-=-=- At 22:59 PDT, you wrote From: rexregum-ga on 14 Jun 2004 22:59 PDT Are the pathnames case sensitive? -=-=-=- To answer your last question, first, the answer is no, the pathnames are not case sensitive. The program I gave you will not work for you as you have now stated the filenames are not unique. I'm really puzzled right now as to how to assist you further. If the filenames are not unique, and the timestamp is after the extension as you have stated in your clarification, then I believe that your problem is merely changing webcam.jpg.200406141152 to (perhaps) webcam200406141152.jpg, which is an entirely different issue. The quickest way to fix it so you can use an image viewer is to copy all the webcam.jpg.############'s to one folder and then (within that folder at a dos prompt) ren *.*.* *.*.*.jpg I agree with Google Answer Researcher pafalafa-ga, though. The copy/paste with bracketted numbers is the easiest when the files are actually the same. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 15 Jun 2004 09:10 PDT |
To crythias, Palalafa, Rainbow et al: I think I now understand why I am getting this error. The temporary internet files folder, it seems, is no more than a convenient way of viewing- just viewing -all the downloaded files in one place. Thus files cannot be renamed there. The files are actually kept in a hidden system of folders, i.e. two levels in, inside the content.ie5 folder, which I shall call subfolders. The files are split in no easily discernable way between these subfolders. Now when multiple files with identical names are saved in one of these subfolders, the usual system of [number] at the end of the filename comes into effect. None of these subfolders can see that the other subfolders can also contain files with the same name, so in each subfolder there could be a webcam.jpg, webcam[1].jpg, a webcam[2].jpg and so on. The confusion arises because the temporary internet files folder only shows the original filenames, without [number] on the end. So when I try to copy the files from the temporary internet files folder, I am in fact copying several of webcam[1].jpg or webcam[2].jpg, each from different folders. Windows presumably sees that the filenames have already been appended and stops there, refusing to rename them again. Files can be renamed in these subfolders. Is there a script that could change part of the name of the files in each of the subfolders differently? That way there wouldn't be any duplication of file names between folders and I could copy them normally, via the temporary internet files folder. e.g. for the first folder: web1cam.jpg, for the next web2cam.jpg and so on. Then windows could just add the number onto the end as normal, and wouldn't replace files when copying. crythias: The script is copying some of the files as it stands, but I don't think it's copying them correctly; there has been no more than one file turning up from each subfolder, and the files that have appeared are mostly or entirely blank, though partially correct [i.e., right resolution/image size]. I think I would be more than happy with a script that just renamed the files based on which subfolder they were in and left them there. Thank you for your help. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 15 Jun 2004 09:20 PDT |
I'd better reply to what you just said; I didn't see it before I made my last post as it took quite a while to proofread. I think that I was mistaken about the timestamp. It is only displayed when viewing the folders in the temporary internet files folders, not when viewing them in the subfolders in content.ie5 It looks something like this: webcam.jpg?14085839786 I know that the ? symbol is not allowed in windows as part of filenames; I strongly suspect that the problem is as I have outlined in my previous post. I now think that the timestamp has nothing to do with this problem. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 15 Jun 2004 09:22 PDT |
Minor correction: for "It is only displayed when viewing the folders..." please read "It is only displayed when viewing the files...". |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 15 Jun 2004 16:45 PDT |
OK, because this requires a bit more than one line of code, may I kindly request you make one more text file and save it? -=-=-updated uberbat.bat-=-=-=- REM @echo off C: cd "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5" REM the unfamiliar /b is a "bare" directory listing. REM it also happens to prepend a directory to a file! dir /a /s /b webcam*.jpg > dirlist.txt del dothis.bat REM change was to call the file. Make sure it is c:\parse.awk awk95 -f c:\parse.awk dirlist.txt > dothis.bat ECHO check dothis.bat to make sure you like it. echo if you do like it, then remove the REM from the next line echo or just run dothis.bat manually. REM dothis.bat -=-=- END uberbat.bat -=-=- HINT: you can change i=0 in the next file to any number that you wish to start counting. -=-=- BEGIN c:\parse.awk -=-=- BEGIN {i=0} { i++ dest=c:\\Documents and settings\\Angharad Miller\\Local Settings\\webcam\\\\ print("copy \042" $0 "\042 \042" dest "webcam" i ".jpg\042") } -=-=- END parse.awk -=-=-=- I am thinking that this will assist you for all files in all sub directories. I *think* you'll like this. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 15 Jun 2004 16:48 PDT |
Oops, remove the REM before @echo off... It'll be less obnoxious. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: rexregum-ga on 16 Jun 2004 09:38 PDT |
Hmm. I've saved the second file as c:\parse.awk and edited the uberbat.bat as you directed, but I'm having a problem. dirlist.txt is forming ok and lists all the files I want, but dothis.bat is always a blank file. Could you confirm exactly which folder I should put awk95.exe in? And is it possible that it needs to be renamed to awk.exe instead of awk95.exe? I have a copy in c:\windows at present, which is named awk95.exe. The -=-=-=- headers and footers seem to be different lengths for the different versions posted; are they arbitrary? |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 16 Jun 2004 10:24 PDT |
You wrote: The -=-=-=- headers and footers seem to be different lengths for the different versions posted; are they arbitrary? -=-=-=-=--=-=-=--== I use the -=-=-=- to separate chunks of data. Ideally (and I apologize if this wasn't clear) you should merely select every line BETWEEEN the -=-=-'s (That is, between the line that indicates BEGIN, and the line that indicates END.) copy, and paste into the file mentioned at the BEGIN tag. the file parse.awk must be located at c:\ and ONLY look like: BEGIN {i=0} { i++ dest=c:\\Documents and settings\\Angharad Miller\\Local Settings\\webcam\\\\ print("copy \042" $0 "\042 \042" dest "webcam" i ".jpg\042") } the uberbat.bat can be anywhere. the awk95.exe can be anywhere in your path, but likely c:\windows is as good a place as any. As long as uberbat.bat uses awk95 as a filename, awk95 must exist. If you included the -=-=-'s in the parse.awk, awk95 will balk :) hee hee :) because awk95 doesn't understand what to do with the -=-=-'s. Please understand, I've tested this so far and have been able to do this with fairly positive success, so I don't want you to feel like I'm using you as a test bunny. If any other commentors or Researchers would like to try this and offer their results, I'd really appreciate the feedback. I'd hate to continue with some flagrant error that I've overlooked... Also, rexregum, you're getting an incredible deal (of course, that will be your opinion) on this because I'm not a Google Answers Researcher, so I can't receive payment for these comments and revisions. As far as I'm concerned, the best answer for Windows is to Find/Search for Files in C:\Documents and Settings\Angharad Miller\Local Settings\Temporary Internet Folders\Content.IE5 that are named webcam*.jpg. Sort by name. Select all of the webcam.jpg Copy to destination folder. create a new destination folder for webcam[1]'s select all of the webcam[1].jpg's in your search results. paste all of the webcam[1]'s into the destination folder for webcam[1] Repeat the last three steps for each webcam[#] The reason is just so the automatic numbering of the multiple copy doesn't interfere. That is to say, in the first webcam destination folder, webcam.jpg will appear, then webcam[1].jpg will appear (it is an automatic rename of webcam.jpg). We can't have all of the Internet Files webcam[1]'s interfere with the webcam[1] that is created, so we put the webcam[1]'s in their own directory. At the point that you've pulled your hair out with my original thoughts, processes, and schemes, why didn't I do this first? Because um. well, the program *is* faster when it works. Your results may vary. |
Subject:
Re: How can I paste multiple files with identical names in XP?
From: crythias-ga on 16 Jun 2004 10:25 PDT |
HI 5 Pafalafa! I just wanted to give you kudos because we came up with it at the same time. Take the money! Please! |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |