quiz: count extensions
quiz: count extensions
This thread was originally posted in the xplorer² Professional forum.
Moved here 19-May-2010 =fg=
=====================================================
as part of some programming i'm doing, i want to count the number of different file types (extensions) on my hard disk. I want xplorer2 to help me with the task but i can't think of an easy way!
i started by flattening all C:\ in a scrap and grouping by extension. Problem is there's no way to get a count of the groups. I could export colum data in excel and write a couple of macros for the counting part, but is there a smarter way to do it using only x2?
( i don't know the answer myself! )
Moved here 19-May-2010 =fg=
=====================================================
as part of some programming i'm doing, i want to count the number of different file types (extensions) on my hard disk. I want xplorer2 to help me with the task but i can't think of an easy way!
i started by flattening all C:\ in a scrap and grouping by extension. Problem is there's no way to get a count of the groups. I could export colum data in excel and write a couple of macros for the counting part, but is there a smarter way to do it using only x2?
( i don't know the answer myself! )
in case you cannot achieve this in xplorer, you could use "WinDirStat" from http://windirstat.info
Actually there's a way I can think of.
I'm always saying there's almost nothing you can't do filewise with x2 (if you don't count out working with the command-line and with an editor).
So here my solution to your challenge:
After flattening select all the files. Use the Batch assistant with Ctr-B and type in mkdir $E (preferably with a path so you get the new dirs at a place you want).
Now you have for each extension a (single) directory. Change to that location, select all dirs in x2 and you see how many items there are = the number of different extensions.
I'm always saying there's almost nothing you can't do filewise with x2 (if you don't count out working with the command-line and with an editor).
So here my solution to your challenge:
After flattening select all the files. Use the Batch assistant with Ctr-B and type in mkdir $E (preferably with a path so you get the new dirs at a place you want).
Now you have for each extension a (single) directory. Change to that location, select all dirs in x2 and you see how many items there are = the number of different extensions.
And in using Excel also, the method does not require any macros:
1. Press ALT+K. Select extension column, and remove other columns.
2. Flatten the folder. Press CTRL+A and then CTRL+P.
3. Paste the list in Excel.
4. Add a column (with QTY as header). Enter 1 (number) in each row.
(TIP: To do this, enter 1 in one cell. Then press CTRL and double-click on thAT CELL'S bottom right corner. The entire column is filled automatically with 1's)
5. Now create a pivot table. Select extension and QTY columns. The sum function will give you the total for each extension.
1. Press ALT+K. Select extension column, and remove other columns.
2. Flatten the folder. Press CTRL+A and then CTRL+P.
3. Paste the list in Excel.
4. Add a column (with QTY as header). Enter 1 (number) in each row.
(TIP: To do this, enter 1 in one cell. Then press CTRL and double-click on thAT CELL'S bottom right corner. The entire column is filled automatically with 1's)
5. Now create a pivot table. Select extension and QTY columns. The sum function will give you the total for each extension.