legiom455 Posted August 21, 2008 Share Posted August 21, 2008 Here's one I really need some help with. I have some images in a folder, say d:\images. In this folder are jpg images, ...ie ...xxx.jpg. AND, some of these jpgs' have been converted to a png file (using same filename, just with a different extension). What I need to do is search thru the d:\images directory, ... and copy ANY jpgs' that do NOT have a corresponding png file... over to a folder named d:\temp. So, after completion, ... d:\temp will contain jpg files that have not been converted to the png format. If anyone can do this ..... FREE BEER all Around!!!!!! thank you in advance! Allen Link to comment Share on other sites More sharing options...
FreeFry Posted August 21, 2008 Share Posted August 21, 2008 Can you not just search for the .png files? Unless there's other non-converted png images? Link to comment Share on other sites More sharing options...
LongBowNZ Posted August 21, 2008 Share Posted August 21, 2008 I would like the beer in advance please. Please send to: 1234 Fake Street, Fake City, Fake Country Seriously though, no one is likely to write the script for you, unless they are bored or something. So here is some functions to look at: FileExists() FileCopy() Post some code and people might be more willing to help. Link to comment Share on other sites More sharing options...
legiom455 Posted August 24, 2008 Author Share Posted August 24, 2008 My biggest challange is trying to figure out how to .."sequence thru" the folder ... to perform the FileExists commands...BTW, I sent that beer, but it came back, .. broken and non deliverable! AllenI would like the beer in advance please.Please send to: 1234 Fake Street,Fake City,Fake Country Seriously though, no one is likely to write the script for you, unless they are bored or something.So here is some functions to look at:FileExists()FileCopy()Post some code and people might be more willing to help. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 24, 2008 Share Posted August 24, 2008 (edited) #include <file.au3> #include <array.au3> $jpgs = _FileListToArray("D:\images", "*.jpg") $pngs = _FileListToArray("D:\images", "*.png") _ArraySort($pngs, 0, 1) For $a = 1 To $jpgs[0] If _ArrayBinarySearch($pngs, StringReplace($jpgs[$a], ".jpg", ".png"), 1) = -1 Then FileCopy("D:\images\" & $jpgs[$a], "D:\temp\" & $jpgs[$a]) EndIf Next No beer for me. Alcohol is bad for the body. Edited August 24, 2008 by Richard Robertson Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now