find folders without mp3 file

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

lin
Bronze Member
Bronze Member
Posts: 131
Joined: 2005 Oct 20, 12:06

find folders without mp3 file

Post by lin »

I have a folder " 1mm" with many subfolders,these contain jpg and mp3 files ; i am trying to figure out how i can search these subfolders with as result the folders which have jpg files but not mp3 files .
thanks,lin
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

can't think of anything except flattening everything, then marking all MP3 in the scrap, removing them and seeing what's left
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Users' Challenge - III

Post by fgagnon »

That's the only thing I could think of, too.
But it's messy in that there will be as many entries for each folder as there are for .jpg files.
And I don't know how to efficiently remove folders that have both jpg's and mp3's without manually trolling through the list.

If it is even possible to do in straightforward manner, it is a candidate for a Users' Challenge, ref: this thread & post.  :twisted:
Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant »

I would try it this way:
1. Go in the left hand pane to the folder 1mm.
2. In the right hand pane, open a random empty folder somewhere outside 1mm.
3. Go to the left hand pane, select all, and open a Robust Copy dialog (F5).
4. Define a Filter, with '*.mp3' in the 'Named' field. For the rest use normal copy settings. This will copy only mp3 files, and the folders in which they are placed.
5. Open the synchronization wizard (ctrl+F9), and compare 'Unique' items on 'Name only', with 'Consider folders, too' checked.
The folders which get selected won't contain any mp3 files in the folder itself or in any of its subfolders.

I don't know if this works for you, because this also means that the UNselected folders might contain one or more subfolders without mp3 files. You just have selected folders on the root level of 1mm.

I think it is possible to get a selection of all deeper subfolders without mp3 files, but I can only think of much more complicated methods.
lin
Bronze Member
Bronze Member
Posts: 131
Joined: 2005 Oct 20, 12:06

Post by lin »

Thank you all for helping out.
there are 540 subfolders , 130 gig ,so i'd better not try any of these solutions.
i do have an alternative way of doing this in my media db although somewhat cumbersome ; i just wondered if there was an easy fast way to do this .
Lin
lin
Bronze Member
Bronze Member
Posts: 131
Joined: 2005 Oct 20, 12:06

Re: Users' Challenge - III

Post by lin »

fgagnon wrote:That's the only thing I could think of, too.
But it's messy in that there will be as many entries for each folder as there are for .jpg files.
And I don't know how to efficiently remove folders that have both jpg's and mp3's without manually trolling through the list.
I only want to remove the folders with no mp3's in it.
All the folders have jpg in it.
tonne
Member
Member
Posts: 25
Joined: 2006 May 26, 10:35

Post by tonne »

If the subfolders are at first level this script will handle the folders

Code: Select all

@echo off
for /D %%d in (*.*) do if not exist %%d\*.mp3 del %%d\*.* & rmdir %%d 
EDITED: away went my testcase...

save as a .cmd file and run it from a cmd-prompt (two lines).

NOTE this will delete all files and remove the folder - try it on a test subset first!
lin
Bronze Member
Bronze Member
Posts: 131
Joined: 2005 Oct 20, 12:06

Post by lin »

tonne wrote:If the subfolders are at first level this script will handle the folders

Code: Select all

@echo off
for /D %%d in (*.*) do if not exist %%d\*.mp3 del %%d\*.* & rmdir %%d 
EDITED: away went my testcase...

save as a .cmd file and run it from a cmd-prompt (two lines).

NOTE this will delete all files and remove the folder - try it on a test subset first!
Thanks ,could you elaborate please , i'm not good on scripts ;the subfolders are located below : H:\1mm\   where would i put this path?
tonne
Member
Member
Posts: 25
Joined: 2006 May 26, 10:35

Post by tonne »

Start a cmd-prompt (start/run/cmd.exe), change active drive h: change active directory cd \1mm (save the script in this folder) and start the script.
Remember to make a test-case or start with this only listing the folders without mp3 files.

Code: Select all

@echo off
for /D %%d in (*.*) do if not exist %%d\*.mp3 echo %%d 
lin
Bronze Member
Bronze Member
Posts: 131
Joined: 2005 Oct 20, 12:06

Post by lin »

tonne wrote:Start a cmd-prompt (start/run/cmd.exe), change active drive h: change active directory cd \1mm (save the script in this folder) and start the script.
Remember to make a test-case or start with this only listing the folders without mp3 files.

Code: Select all

@echo off
for /D %%d in (*.*) do if not exist %%d\*.mp3 echo %%d 
only the listing works ok, but i get : " The syntax of the command is incorrect." using the delete code.
Lin
EDIT i put the code on 2 lines like you said ,i now get : "The system cannot find the file specified."
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

For a slightly less nuts and bolts approach, try this handy little freeware programme designed specifically for finding/removing empty folders.  A simple option can be set to not consider *.JPG's, thus considering the folder empty if no other file types exist.  Very handy for managing those pesky multi-foldered music collections.  (Obviously nothing is deleted without confirmation, so it's safe to experiment with.)

RED (Remove Empty Directrories

Happily works in XP or Vista, any flavour.
lin
Bronze Member
Bronze Member
Posts: 131
Joined: 2005 Oct 20, 12:06

Post by lin »

Kilmatead wrote:For a slightly less nuts and bolts approach, try this handy little freeware programme designed specifically for finding/removing empty folders.  A simple option can be set to not consider *.JPG's, thus considering the folder empty if no other file types exist.  Very handy for managing those pesky multi-foldered music collections.  (Obviously nothing is deleted without confirmation, so it's safe to experiment with.)

RED (Remove Empty Directrories

Happily works in XP or Vista, any flavour.
Thank you for thr tip, but this issue is incidential  ,no use installing an app just  to use it once.
Cheers,lin
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

lin wrote:...no use installing an app just  to use it once.
It's a pity bloated malware like Adobe-(anything) and the like have instilled an honest dislike of any superfluous installation procedures.  Fair enough, I try to run a clean ship too.  Unwarranted in this case.  It's harmless, unintrusive, and surprisingly handy in the unknown future.  And far less likely to lead to accidental "Oops" moments as ad hoc scripting has been known to do. :D

To each their own.
desslok
Bronze Member
Bronze Member
Posts: 167
Joined: 2008 Jan 16, 22:10

Post by desslok »

If you extract RED with Universal Extractor, you can use it out of the box. In other words it's portable. It still needs .NET though.
tonne
Member
Member
Posts: 25
Joined: 2006 May 26, 10:35

Post by tonne »

The two lines are:
Line1:

Code: Select all

@echo off
Line2:

Code: Select all

for /D %%d in (*.*) do if not exist %%d\*.mp3 echo %%d 
Which windows version - it works fine on vista.
Post Reply