another quiz: filter challenge

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

if you click the autofilter button it will show you what extensions are in the active folder

to actually put that info in a text file would most likely require a script
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

RTC,

Not knowing whether the files you want are all in one folder, or scattered about, I will assume they are not in a single folder:

1. Initiate a search (Ctrl+F) for all files with the extension(s) you are interested in, specifying the "Look in" folders where the files exist (use a comma-separated list).
2. In the resulting scrap pane, select the ones you want (Ctrl+A will do it if you want them all)
3. Copy the names to the windoze clipboard using Alt+C (full paths are copied along with the names)
4. Paste the result (Ctrl+V) into the text file of your choosing.

Admittedly not elegant, but straightforward nevertheless. ;)
RTC
Member
Member
Posts: 41
Joined: 2007 Jan 24, 23:06
Location: Paramaribo-Suriname

Post by RTC »

FrizzleFry & fgagnon,

thanks for your replies..

FrizzleFry,

I indeed noticed autofilter shows all the extensions in a particular folder but I have multiple folders where files are located.
And as you said putting those extensions into a text file is cumbersome...

fgagnon,

the files are scattered about…multiple folders and files all over the harddisk; with the help of junctions I got them all into a backup folder

when initiating a search I don’t know which extensions there are…That’s what I was looking for…which extension are in the various folders; I just need all the unique extensions

Thanks for pointing me in a direction…will continue my research in this matter and still looking forward to other / different solutions…
Doesn’t have to be elegant….straightforward will be fine   :)

***RTC***
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

last time i wanted to do that very same task i ended up writing a small program for it; i found 1166 extensions!

x2 could do this (inefficiently) if you flattened your entire hard disk, then grouped by extension (sort by it and then activate grouped mode). Then you'll need a command that doesn't yet exist (i plan to add it) to copy group headers as text. So all in all x2 can't help you here!
User avatar
snakebyte
Gold Member
Gold Member
Posts: 430
Joined: 2003 May 07, 07:14
Location: Seattle
Contact:

Re: Help with "how do I..."

Post by snakebyte »

RTC wrote: -- lot of different type of files
-- need to know which sort of extensions I have
-- so not all the files but just one of the extensions
-- in a txt file
I think using WinDirStat would be more appropiate for this task.

In the screenshot below, the highlighted area shows the info you are interested in.
Image
Help! I'm an AI running around in someone's universe simulator.
BRX
Silver Member
Silver Member
Posts: 304
Joined: 2002 Feb 08, 12:12

Post by BRX »

You can do this with x2 by tweaking my "trick" a little.

1.) Flatten the contents of the respective folders in one scrap pane
2.) Create a folder somewhere else, e.g. c:\extensions
3.) Select all the items in scrap and use batch wizard with something like
copy "$N" "c:\extensions\extensions.$E"
(additionally you need the switch for overwriting or xcopy with switch, I'm writing this on the fly and didn't check for syntax)
4.) You should have now one file each for each extension in the extension dir and can copy the list from there with x2

Just for the general idea.
Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant »

With some help of third party software, this would be my trick:
1) You have all the files in one scrap container;
2) With 'view' - 'select columns', you remove all columns from the current scheme, except for the 'extension (s)';
3) Select all files;
4) 'Edit' - 'copy columns'
5) Open some spreadsheet program, like OpenOffice Calc, or MS Excel, and paste in the first column
6) Find a way to remove, or filter out, duplicate rows.... That's an open end, but I know it is possible for both mentioned programs. With Calc, you can do something with the 'standardfilter' and a 'no duplicate' option. Excel has some function somewhere that does the same. I don't use these programs very often, so please find out yourself  :wink:
From here, it is easy to copy the result in a txt file.
RTC
Member
Member
Posts: 41
Joined: 2007 Jan 24, 23:06
Location: Paramaribo-Suriname

Post by RTC »

Nikos,
So all in all x2 can't help you here!...
that's not an option Nikos...  :wink: I know xp2 must can do this...vide infra

snakebyte,
I think using WinDirStat would be more appropriate for this task
Yes, snakebyte, that's pretty close...I dl WinDirStat and indeed gave me the info I was looking for...Thanks for this tip.... :)

BRX,
You can do this with x2 by tweaking my "trick" a little.
I'm still looking at this one...need to study batch wizard but seems doable...thanks... :)

Mr.Pleasant,

your solution did the trick....that's exactly what I was looking for....I loaded the extensions into a database so sorting the whole bunch was pretty straightforward...
A virtual bottle of wine is yours... :lol:
Thanks again, and all others who helped me out / pointed the way...

                  *** RTC ***
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

That idea of Mr.Pleasant's reminded me that I do a similar thing in a spreadsheet I use to monitor potential repeat spammers on the board.
[so I resolved to go off and work it out step-by-step and check it for special case errors ... and then got caught up in the business of life outside x2  :D ]

It worked very well, but when I got back, I see RTC also found that out using his own tools.  

FWIW, to others who might not have the database tools RTC used, here's my procedure using MS Excel as the helper app.

Adapting the idea (I use MS Excel 2002), and after testing for special cases where MS tries to make Excel smarter than it should be (to "help" the user) -- my detailed procedure, which also counts the number of files having each extension, is as follows:
1.) You have all the files in one scrap container;
2.) With 'view' - 'select columns', you remove all columns from the current scheme, except for the 'extension (s)';
3.) Sort on the 'extension' column
4.) Select all files.
5.) 'Edit' - 'copy columns' [Ctrl-P]
6.) Open MS Excel, and format column A "as Text" (to keep Excel from converting numeric-looking text into a number for cases where there are file extensions such as .001, .01, etc.)
7.) Paste the contents of the clipboard at cell A1.
(The following extra step, 8a/b, is also to keep Excel from converting numeric-looking text into a number when we use it in a formula in step 9a/b.)
8a) Enter the following formula into cell C2:

Code: Select all

="|"&A2
8b.) copy that formula down column C to match the rows of entries in your list.  Excel will automatically adjust the row references in the formula.
9a.) Enter the following formula into cell B2:

Code: Select all

=if(C2<>C1,countif(C:C,C2),0)
9b.) Copy that formula down column B to match the rows of entries in your list.  Again, Excel will automatically adjust the row references in the formula.
10.) Hit F9 to calculate the spreadsheet if it doesn't automatically do so.
Each non-zero entry in column 'B' is a count of the number of files in the list having the extension shown in column A.  To view only those rows do the next steps.
11.) Select Row 1 and activate the Data | Filter | AutoFilter tool. (may need to install the 'analysis toolpack' if it's not already installed)
12.) Click the little down-triangle on cell A1 and define a 'Custom' sort for value greater than 0.

Viola!  
The unique extensions from column A can be copied to a text file, and the file counts for each extension can be copied from column B.  

A lot of steps, but straightforward if you are familiar with the tools involved. ;)

PS - note that because of limitations in Excel 2002 this only works for up to 65535 items at a time.  Any bigger than that and you would have to split the list up into chunks, or use a more current version of Excel.  Excel 2007 will support over a million items.

-fg-
BRX
Silver Member
Silver Member
Posts: 304
Joined: 2002 Feb 08, 12:12

Post by BRX »

You're all cheating. My solution is still the only native one. ;-)
Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant »

You're right actually, BRX. Want to share that virtual bottle of wine (thanks for that, RTC  :) )?
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

BRX,

Indeed, we are... but I got my results in just a couple of minutes of work. (Test case was a branch with 960 files having 106 unique 'extensions'.)

I like your idea very much for its 'thinking sideways' about the problem, but when I tried it I could not get it to work, so I abandoned it. :(  
Did you try it yourself?
Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant »

but when I tried it I could not get it to work
It might work, but not when you have all your files in the scrap container. In that case you should use

Code: Select all

copy "$F" "c:\extensions\extensions.$E" 
Notice the '$F' instead of '$N'.
The thing I don't like about it, is that it might need a lot of free disc space, in order to copy the files. I'd suggest  

Code: Select all

md "c:\extensions\$E"
to put in the command script, while you have all files selected.
Clicking on 'Execute (DOS)', You should get a folder full of empty folders, named after the extensions of selected files (one of each extension). Of these you could get a list using 'copy columns'.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

"$F" vs. "$N" makes BRX's idea work.
I should have realized that myself. :oops:
But it takes a long time to copy/overwrite many files (unless there is a copy or xcopy switch for "no to all" that I did not find).  ... and if there are hidden files with unique extensions, you also need the /H switch.

On the other hand the modification to BRX's idea where
Mr.Pleasant wrote:

Code: Select all

md "c:\extensions\$E" 
works very quickly and gets my vote :thumbup: (unless one also needs a count of how many files there are for each extension ;) ).
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

You could do

echo $F >> "c:\exts\$E"

you would end up with text files named for each extension containing lists of the files which would give you the count.

For all these solutions using the file system you would want to start which a clean c:\exts folder and you would need a check for blank extensions.
Post Reply