crossbone Posted November 22, 2009 Report Share Posted November 22, 2009 Greetings,I would like to know if this can be done in win xp environment. say I have a folder, A, of pictures only and they all have file extensions jpg eg abc.jpg, xyz.jpg. say I have a second folder, B, which contains all the files of A(if you ignore extensions) and more(but all are pictures.) But all the files in B has extensions NEF instead of jpg eg abc.NEF, efg.NEF, xyz.NEF. My idea is to extract all the files from B that has the same the name as A(ignoring extensions) and either move or copy to a separate folder ie if A contains abc.jpg, xyz.jpg then abc.NEF and xyz.NEF will be extracted and moved/copied to a new folder. I'm not sure where to start. is there a program out there that can do this? or there's a special command to type at the command prompt? Hope someone can help.thanks! Quote Link to comment Share on other sites More sharing options...
Hb_Kai Posted November 22, 2009 Report Share Posted November 22, 2009 This should be able to be done with a batch script, though, you may have to wait for someone to correct the code I'll give. I'm not really much a batch programmer, I only know a few commands here and there so don't know if it would work.cd C:\Documents and Settings\*user*\My Picturesmkdir NEF-extensionscd FirstFolderIf *.NEF exists then copy C:\Documents and Settings\*user*\My PIctures\NEF-extensionscd SecondFolderIf *.NEF exists then copy C:\Documents and Settings\*user*\My PIctures\NEF-extensionsIn this example, I just assumed your pictures are stored at the My Pictures directory.Made a new folder in My Pictures called NEF-extensions.Assumed the first folder you want to search through is called FirstFolder and the second folder is SecondFolder.Copied all the .NEF files from the My Picutres/FirstFolder to NEF-extensions.Coped all the .NEF files from the My Pictures/SecondFolder to NEF-extensions.Just copy that code into notepad, change the FirstFolder and SecondFolder names to your own folders and also change the directory of the My Pictures folder to where you have your main pictures folder if it's different, then save it as something like NEF-Cleaner.bat and on the bar beneath the name, use the All Files option.Also, change the *user* part of the directory to whatever your user account is. That should do it but, like I said before, you should probably wait for someone to correct some of it as the codes syntax may be wrong. But yeah, if it works, all you should have to do after this is just double-click the NEF-cleaner and it should do it all for you. Quote Link to comment Share on other sites More sharing options...
Hb_Kai Posted November 22, 2009 Report Share Posted November 22, 2009 Can't edit anymore :(I know I done some of that wrong, I meant to do it this way...cd C:\Documents and Settings\*user*\My Picturesmkdir NEF-extensionscd FirstFolder mv *.NEF C:\Documents and Settings\*user*\My PIctures\NEF-extensionscd SecondFolder mv *.NEF C:\Documents and Settings\*user*\My PIctures\NEF-extensionsThe cp command, if I can remember rightly, moves all of the said files. In this case, the asterisk says not to bother about the name, what's important is what comes after the name, meaning, .NEF. And it should move all of the files with the NEF extension.But still, wait to see if someone corrects me first before running this batch file. Quote Link to comment Share on other sites More sharing options...
crossbone Posted November 22, 2009 Author Report Share Posted November 22, 2009 Can't edit anymore :(I know I done some of that wrong, I meant to do it this way...cd C:\Documents and Settings\*user*\My Picturesmkdir NEF-extensionscd FirstFolder mv *.NEF C:\Documents and Settings\*user*\My PIctures\NEF-extensionscd SecondFolder mv *.NEF C:\Documents and Settings\*user*\My PIctures\NEF-extensionsThe cp command, if I can remember rightly, moves all of the said files. In this case, the asterisk says not to bother about the name, what's important is what comes after the name, meaning, .NEF. And it should move all of the files with the NEF extension.But still, wait to see if someone corrects me first before running this batch file.hmmm... I don't think this solves the problem. lemme clarify the situation:older A contains files a.jpg, b.jpg, k.jpg and x.jpgfolder B contains files a.NEF, b.NEF, c.NEF, d.NEF, e.NEF, k.NEF, l.NEF, x.NEF, z.NEFthis is what I want:B-->[some filter that takes the list of file names from A]-->Cresulting in C containing a.NEF, b.NEF, k.NEF and x.NEF(notice same a,b,k and x files as in A but with different extensions? and C doesn't contain extra files c,e,l, and z) Quote Link to comment Share on other sites More sharing options...
Hb_Kai Posted November 22, 2009 Report Share Posted November 22, 2009 I'm lost. So you want to copy a.NEF, b.NEF, x.NEF, x.NEF and a.JPG, b.JPG, k.JPG and x.JPG to folder C and not to contain any other files? Quote Link to comment Share on other sites More sharing options...
crossbone Posted November 22, 2009 Author Report Share Posted November 22, 2009 I'm lost. So you want to copy a.NEF, b.NEF, x.NEF, x.NEF and a.JPG, b.JPG, k.JPG and x.JPG to folder C and not to contain any other files?no. folder B does not have any JPG files at all. they are all NEFs and I want folder C to have only NEFs files, too. let me clarify again:Folder A files:a.jpgb.jpgk.jpgx.jpgFolder B files:a.NEFb.NEFc.NEFd.NEFg.NEFf.NEFk.NEFl.NEFx.NEFz.NEFnotice that B has files with a, b, k and x names BUT the files have extension NEF instead of JPG? I want an batch process that will go through folder B and produce a folder C such that C contains only:Folder C files:a.NEFb.NEFk.NEFx.NEFsee how C has files with the same name as those in A but no JPGs!!! C only has NEF files. when I say name, I'm ignoring JPG and NEF extensions. the process would definitely need to reference the list of names(and ignoring JPG extension) in A when selecting the files in B. A is used as part of the filtering process. Quote Link to comment Share on other sites More sharing options...
AlanHo Posted November 22, 2009 Report Share Posted November 22, 2009 It's all too technical for me - and it might take ages to develop a batch file to do it.If I had the problem I would simply copy all the files in folders A and B into one temporary folder so they are listed in alpha numeric order. Thus files with the same names would be together.I could then easily see those with the same names and - with Windows Explorer - manually move the ones I wanted with a NEF extension into the required folder before deleting the temporay folder. Holding down the Ctrl key whilst clicking on the files to be moved by drag and drop would enable them to be moved in "batches".I would probably do the job in less time than fiddling with a dodgy batch file. Quote Link to comment Share on other sites More sharing options...
crossbone Posted November 22, 2009 Author Report Share Posted November 22, 2009 It's all too technical for me - and it might take ages to develop a batch file to do it.If I had the problem I would simply copy all the files in folders A and B into one temporary folder so they are listed in alpha numeric order. Thus files with the same names would be together.I could then easily see those with the same names and - with Windows Explorer - manually move the ones I wanted with a NEF extension into the required folder before deleting the temporay folder. Holding down the Ctrl key whilst clicking on the files to be moved by drag and drop would enable them to be moved in "batches".I would probably do the job in less time than fiddling with a dodgy batch file.that's fine if you're only doing it once but if you're handling hundreds of files and doing this a few times a week, the manual route becomes a pain. Quote Link to comment Share on other sites More sharing options...
Hb_Kai Posted November 22, 2009 Report Share Posted November 22, 2009 Yeah, the only way I know of for making a batch file for this would be to use the tree command in each folders to make a file list then for the batch commands to read and compare the lines of names and if there's a match, test to see what the extension is then do what it wants with it but like I said before, I'm not batch programmer... :)It would probably be quicker to do it in two windows explorer windows, halving them on the monitor so you can go through them both manually then do what you want with the contained files. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.