Solved

Retrieve file extensions from folder structure (recursive)?

Posted on 2010-09-06
3
519 Views
Last Modified: 2012-05-10
I've a folder structure starting from c:\data and need to know all FILE EXTENSIONS used, recursively? Rgds
0
Comment
Question by:go4java
3 Comments
 
LVL 2

Expert Comment

by:DavidGerald
ID: 33609879
A bit vague, why recursively?

Is it because you need to get a list of all files with extention of type A, then another list of all extentions type B, then type C etc?  Or do you just need a list of files with ordered by extention?
 Do you just need to know what extentions there are and how many?

0
 

Author Comment

by:go4java
ID: 33609923
..yes, I need a list of all file extensions and they I will have extract certain file types.
I just found a way with Total Commander, sleceting all file types *.* and retrieving all exztensions ftom that list. Thnaks
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 33610131
How about this batch file.  It will keep a running count of all files.  remove the line

  echo %%~xA, !%%~xA!

to stop the progress details and speed it up somewhat...

Steve

@echo off
setlocal enabledelayedexpansion
cd /d c:\data
for /F "tokens=*" %%A in ('dir /a-d /b /s *.*') do (
  set /A %%~xA=!%%~xA! + 1
  echo %%~xA, !%%~xA!
)
set . > extensions.txt
endlocal
START notepad extensions.txt

You end up with something like this in a text file in Notepad:


.bat=11
.bmp=2
.cmd=233
.csv=5
.db=1
.exe=3
.htm=7
.html=2
.jpg=3
.js=4
.lnk=1
.mbf=1
.php=1
.prn=3
.reg=2
.sep=1
.sk=1
.txt=36
.vbs=46
.xls=1
.zip=1

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now