Latest post Wed, Aug 19 2015 5:14 PM by briMestone. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Sun, Aug 16 2015 11:47 AM

    • Greg_OR
    • Not Ranked
    • Joined on Thu, Oct 13 2005
    • Poland
    • Posts 4
    • Points 40

    Avid MediaFiles Counter batch script

    Hi, when working with lots of media and a couple of editors without Unity - using only network drives to share content its easy to mess up.

    When moving the media files manualy I found it usefull to count media files in media directories to check if they dont exceed 5000 number given by Avid, and by my experience its better to keep the files number around 2500 in each folder for better overall performance.

    So I created small batch script that lists all Avid MediaFiles\MXF folders with files count distinguishing those which exceeds 5000 (default) or any other number you can pass to the script as an parameter.

    Maybe somebody else will also find it usefull.

    I cant attach a .bat file here so I attached amfc.txt file, you must change file extension to .bat in order to execute it)

    here is the code:

    @echo off
    rem script for counting files in Avid MediaFiles directories on all drives
    rem you can add a parameter to the script eg. "amfc 2500"
    rem to distinguish folders with file count exceding this number
    rem default is 5000
    rem this script is provided as is with no warranty by Greg_OR

    if [%1]==[]    (set max_count=5000) else (set max_count=%1)
    set DRIVES=
    for /f "skip=1 delims=" %%D in ('wmic logicaldisk get caption') do set DRIVES=!DRIVES! %%D
    for %%D in (!DRIVES!) do for /D %%K in ("%%D\Avid MediaFiles\MXF\*") do (
      set count=0
      for %%x in ("%%K\*") do set /a count+=1
      if !count! GTR !max_count! (
            echo -----------------------------------------------
            echo !count!    %%K
            echo -----------------------------------------------
        ) else echo !count!    %%K
    @echo on

    and some sample output with 2500 parameter:

    >amfc 2500

    100     M:\Avid MediaFiles\MXF\1
    1148    M:\Avid MediaFiles\MXF\100929
    2       M:\Avid MediaFiles\MXF\18
    227     M:\Avid MediaFiles\MXF\2
    49      M:\Avid MediaFiles\MXF\5
    2       M:\Avid MediaFiles\MXF\6
    7       M:\Avid MediaFiles\MXF\7
    163     M:\Avid MediaFiles\MXF\8
    95      M:\Avid MediaFiles\MXF\800
    2605    M:\Avid MediaFiles\MXF\9
    2       M:\Avid MediaFiles\MXF\99990
    1392    M:\Avid MediaFiles\MXF\99999
    286     S:\Avid MediaFiles\MXF\1


    Symphony 7, 6 MC 8, 7 Nitris and Mojo, HP workstations [view my complete system specs]
  • Wed, Aug 19 2015 5:14 PM In reply to

    • briMestone
    • Not Ranked
    • Joined on Fri, Nov 18 2005
    • San Francisco
    • Posts 140
    • Points 1,570

    Re: Avid MediaFiles Counter batch script

    Good one Greg!

    I'd ilke to contribute and provide same logic for our Unix friends.

    #Usage: /samplePath/Avid\ MediaFiles/MXF/

    for dir in `find $1 -type d -maxdepth 1`
    count=$(ls $dir/ | wc -l)
    if [ $count -gt 2500 ]
    echo "———>" $count $dir;
    echo $count $dir;

    Now, we can push this some more and do the auto sorting of files acrross multiple client folders. Again, Great Job Greg!
    6 ISIS5000 split in two environments, 25 MC7+SYM NitrisDX, MacPro3,1 MacPro4,1 [view my complete system specs]


    Ted Simbajon

    Head Janitor

Page 1 of 1 (2 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller