Making An Inventory Of A Hard Drive Or Directory
<h3 class="heading-h6"><a name="THLToolboxHomegtMiscellaneousTechnicalProcessesgtMakinganInventoryofaHardDriveorDirectory" class="anchorpoint"></a><a href="/tools/wiki/Home.html">THL Toolbox</a> > <a href="/tools/wiki/Miscellaneous%20Technical%20Processes.html">Miscellaneous Technical Processes</a> > Making an Inventory of a Hard Drive or Directory</h3><p class="paragraph">
</p><h3 class="heading-h1"><a name="MakinganInventoryofaHardDriveorDirectory" class="anchorpoint"></a>Making an Inventory of a Hard Drive or Directory</h3><p class="paragraph"><strong class="bold">Contributor(s):</strong> Brad Aaron, Andres Montano, Steve Weinberger</p><p class="paragraph">In OS X, open terminal, navigate to the hard drive volume you want to catalog (cd volumes)</p><p class="paragraph">When you are in the root directory of the volume to be cataloged, type:</p><div class="code"><pre>ls -R | grep <span class="java-quote">":$"</span> | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'</pre></div><p class="paragraph">into the command line (copy and paste from here)</p><p class="paragraph">Then copy and paste the results of the directory index (which indexes the entire drive by directory, sub directories and files) into a new section below. Make sure to paste into the 'Wiki Markup' window and include the tags </p><div class="code"><pre>--------
around the pasted lists.
--------</pre></div><p class="paragraph">How to find a list of all FCP files within a directory or volume on OS X *(limited usefulness since mac files are categorized by resource forks and not by file extensions, so some older files don't have the *.fcp file extension)*:</p><div class="code"><pre>find /volumes/VOLUMENAME -name *fcp</pre></div><p class="paragraph">
</p><h3 class="heading-h6"><a name="HowtogetalistofallfilesofkindFinalCutProProjectFileUSETHISMETHOD" class="anchorpoint"></a>How to get a list of all files of 'kind' Final Cut Pro Project File *(USE THIS METHOD)*:</h3><ul class="star"><li>Download and install the [PrintWindow|<img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://www.searchwaresolutions.com/" target="rwikiexternal">http://www.searchwaresolutions.com/</a></span>] application for OS X.</li>
<li>Open print window and hit Command + P to enter the "Print Folder Listing…" dialogue.</li>
<li>Navigate to the volume you want to get the file names from and click 'select'</li>
<li>Choose the icon that says "File"</li>
<li>Under the Layout tab select Style Excel File and under Folder Expansion section, "Expand all folders"</li>
<li>Then, under "Fields & Sorting" tab, check off all file information and check "Use Full Path for Name"</li>
<li>Click Save</li>
<li>Save the file and the app will begin to run. On a large volume it will take quite a while to go through all the folders.</li>
<li>When it's finished, you will have an excel spreadsheet with separate columns for the file name/path and other selected "file information". Sort this list by the "file information" for "kind" and then select the name/path for all Final Cut Pro Project Files</li></ul><p class="paragraph">How to separate the file name from the path to add both path and file name to a spreadsheet for wrangling:</p><div class="code"><pre>You need to <span class="java-keyword">do</span> <span class="java-keyword">this</span> in a text editor that supports Regular Expression searching. [Textmate|<img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://macromates.com/]" target="rwikiexternal">http://macromates.com/]</a></span> (proprietary software <span class="java-keyword">for</span> Mac OS, oXygen, etc) For Windows, there is [Notepad RE|<img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://www.codeproject.com/Articles/4600/Notepad-RE-Regular-Expressions]" target="rwikiexternal">http://www.codeproject.com/Articles/4600/Notepad-RE-Regular-Expressions]</a></span> free text editor.
Open a <span class="java-keyword">new</span> file in the text editor
Copy the column of data from the spreadsheet and paste it into the text editor file
Select Regular Expression in the search-and-replace box
$ In the Text to find box enter: ([^/]+)$
In the Replace with box enter: $1t$1
Press Replace all
This will add a tab and then the filename <span class="java-keyword">for</span> each row
Copy <span class="java-keyword">this</span> and paste it into 2 columns in the Excel doc
If the directory path uses backward slashes rather than forward slashes, in the Text to find box replace the forward slash with two back slashes.</pre></div><p class="paragraph">After you have separated the filename from the path, you can copy and paste the corresponding column into the AV wrangling spreadsheet in the right location.
</p><h3 class="heading-h6"><a name="ProvidedforunrestrictedusebythespanclassnobrimgsrcsakairwikitoolimagesicklearrowgifaltexternallinktitleexternallinkahrefhttpwwwthliborgtargetrwikiexternalTibetanandHimalayanLibraryaspan" class="anchorpoint"></a><em class="italic">Provided for unrestricted use by the <span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org" target="rwikiexternal">Tibetan and Himalayan Library</a></span></em></h3>