Hi Everyone,<\/p>\n
I do lot of photography and since each picturave 2 file (raw and Jpeg) ill review them first in Jpeg since its faster than check the raw and then i delete the picture i dont want but it left the raw in the folder.<\/p>\n
im trying to make a scriptes who check the folder files and erase all file who are alone, like if the script see the picture 001.jpg and 001.raw then its fine, but if the scripte see 002.jpg only (or raw) then he erase it.<\/p>\n
Hope its clear and someone will have a soluce.<\/p>\n
Cordialement,<\/p>\n
Dino<\/p>","upvoteCount":3,"answerCount":4,"datePublished":"2021-09-04T11:27:55.000Z","author":{"@type":"Person","name":"spiceuser-ncg3v","url":"https://community.spiceworks.com/u/spiceuser-ncg3v"},"suggestedAnswer":[{"@type":"Answer","text":"
Hi Everyone,<\/p>\n
I do lot of photography and since each picturave 2 file (raw and Jpeg) ill review them first in Jpeg since its faster than check the raw and then i delete the picture i dont want but it left the raw in the folder.<\/p>\n
im trying to make a scriptes who check the folder files and erase all file who are alone, like if the script see the picture 001.jpg and 001.raw then its fine, but if the scripte see 002.jpg only (or raw) then he erase it.<\/p>\n
Hope its clear and someone will have a soluce.<\/p>\n
Cordialement,<\/p>\n
Dino<\/p>","upvoteCount":3,"datePublished":"2021-09-04T11:27:55.000Z","url":"https://community.spiceworks.com/t/delete-file-who-have-not-his-double-in-the-folder/810276/1","author":{"@type":"Person","name":"spiceuser-ncg3v","url":"https://community.spiceworks.com/u/spiceuser-ncg3v"}},{"@type":"Answer","text":"
You can take this code and possibly pipe it or use a foreach loop to delete the results where the file count is 1. Obviously, you would change the code from -gt<\/strong> to -eq<\/strong>.
\nI will say though, this code hinges on the filenames matching exactly for your jpg and raw version.<\/p>\n