dirtab(in)

Version 1.0.0.0 (3,69 KB) von Julian
Tabulate directory list (dir results as table also with extension)
57 Downloads
Aktualisiert 26. Feb 2018

Lizenz anzeigen

Anmerkung des Herausgebers: This file was selected as MATLAB Central Pick of the Week

files = dirtab(in) returns the directory listing of in as a table. MATLABs builtin DIR command generates directory listing but the struct it would return is converted into a table. The variable names of the resulting table are the field names as returned by DIR, supplemented by 'ext' which identifies the file-extension, and folder (returned by DIR only since R2016b).
The differences between dirtab and dir are as follows:
+ DIRTAB returns a table instead of a struct
+ DIRTAB adds the variable folder, even before R2016b. A trailing filesep is added (not done by DIR in R2016b)
+ The name column does not include the file extension, which appears in a separate column
+ The date column now contains datetime representation of file dates instead of cellstr text.
+ the pseudo-dirs '.' and '..' don't appear in table rows.
Tabulating the directory with dirtab makes it easier to sort by file size or file extension, say, using sortrows. The first 3 columns are folder, file, and ext which can be catenated to obtain full file paths.

Zitieren als

Julian (2024). dirtab(in) (https://www.mathworks.com/matlabcentral/fileexchange/66213-dirtab-in), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2014b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu File Operations finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0