Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am seeking to understand that "average" file size for a folder on my computer. I have calculated the true average of files (total size / no. of files), however I would, ultimately, love to group together files into file-size categories as follows;

Files < 1kb: 23 files.
Files < 100kb: 276 files.
Files < 1mb: 786 files.

Is this possible using a batch script?

share|improve this question
    
I smell XYZ problem here... –  Hello71 Jul 21 '11 at 16:36

1 Answer 1

Yes this is possible.

You will need to write some code that follows along an algorithm of your choice, using variables to store values.

The algorithm could look perform actions like this:

  • define File-Size-Range-Groups ( < 1kb, < 100 kb, etc )
  • Sum the number of files in each File-Size-Range-Group
  • Sum the individual file sizes for a File-Size-Range-Group total
  • Output the sum value of files in a File-Size-Range-Group
  • Output the average (total file size sum for File-Size-Range-Group / number of files in File-Size-Range-Group)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.