I've got two tasks:
I've set up my digital library in the format of a Dewey Decimal Classification, so I've got a 3-deep hierarchy of 10 + 100 + 1000 folders, with directories sometimes going a little deeper. This library structure contains my "books" that I would like to list in a catalog (perhaps a searchable text document). It would be preferable, though not absolutely necessary, if I could view the parent directory name in a separate column next to each "book".
The problem is that some of the "books" in my library are folders that stand alone as items. I planned ahead when I devised this system and made it so that each item in my library would contain a tag in
[]
s that would contain the author name, for instance, and so the idea is that I would try to perform a recursive listing of all of this, but end each recursion when it encounters anything with a[
in the name, directory or file.
How might I go about this? I know a bit of Python (which is originally what I used to create the library structure), and since this is on an external hard drive, I can do this in either Windows or Linux. My rough idea was to perform some sort of a recursive listing that would check the name of each directory or file for a [
, and if it did, stop and add it (along with the name of the parent directory) to a list. I don't have any idea where to start.