You could,do this with Terminal (bash) commands, if you’re open to that. There is a near-infinite number of ways to gather and format the text.
stat -f "%N,%z" | pbcopy
cd changes directory to the folder you’re interested in.
~ is your home folder. In Finder, this would be the house icon with your user name. Then moves into the
Documents folder and
stat -f "%N,%z" prints the file name (
%N), then a comma, then the file size (
The vertical bar (also called pipe) sends the output of the
stat command to the pasteboard copy command
Now, switch over to Excel (I assume) and Cmd+V to paste.
If you’re lucky, you’ll get two columns, filenames, and sizes. If it pastes in as one column, use
Text to Columns... in the
Data menu to convert it to separate columns. Choose the comma as the separator. I just did that on my sample data, and Excel remembered it so I didn’t have to do it again for this spreadsheet.
Here’s a sample of what the command produced on my system.
EEG Processing Pipeline.pdf,34134
Jean-Léon Gérôme and Polychrome Sculpture.pdf,371825
Kolbe A Result for John Johnson.pdf,1376239
Misinterpretation of one of Issac Newtons writings.pdf,412847
For this example, I limited it to only .pdf files in my
Documents folder by using this command:
stat -f "%N,%z" *.pdf | pbcopy
And in the spreadsheet: