Exporting path name by folder/directory

I'm trying to do a "catalog" of my files. I am trying to get an EXPORT list which includes the top directory and each level below as separate fields. I do want to repeat all the directory info with each row.

Sometimes that goes several levels deep especially in classical:
Example:
Classical-Orchestral
Beethoven
Symphonies
Sym #1 with folder for each Symphony.
wav
flac

I tried %_directory% and %_parent_directory% but I did not get all the levels (as separate fields)

How can this be done?
Thanks.

While it isn't accomplished in Mp3tag, I have found a freeware program called Snap2HTML that does a wonderful job of creating a catalog. Check it out at Snap2HTML.

It would be nice to see what you have done so far.

In which fields would you find that information? The _PATH?
You would probably need a $loop() statement for each piece of information by which you want to sort and group.
And if you find the information only in the _PATH, then you have to think about a way to split the string so that you have each folder level separately.
I doubt, though, that you can cater with the same script for, let's say one set of files 4 folder levels deep and one that is 6 levels deep.

Thanks for the advice but Snap2 will not work for my needs. I will be sending lists to others and want to be able to sort and select files easily. HTML would not be appropriate.
However, I might have other uses for the software.

The information is in the _PATH. Not sure a loop would work and you are right about not being able to use the same script. I have encountered situations like this before and there doesn't seem to be any simple way to resolve it.

I initially used the PATH and did Text to Columns in Excel. It broke out each level of directory into a column but the fields in each column varied after the first directory level. I can insert columns to line them up but with 30K rows that isn't easy. I will probably break down the list into different segments and "fix" the list manually.

Just thinking ...
If you have the path ... and the path has the backslash as separator ... and you want to get a (text) list when you could sort by the path and replace every backslash with a tab character so that you can transform the resulting text file into a table.

And then you could check before you write the last tab character how deep the folders are nested with a calculation like this:
"$add($len($regexp(%_path%,'[^\\]',)),1)"
and write as many tab characters as are missing for the maximum depth - this maximum depth you would have to define.

I think you are on to something here.

I really don't know how to perform a nested calculation and writing the tab characters. Since I am doing this once I'm not sure I want to learn.

What would be the selection criteria on the recipients' side?
Are they really interested in your folder structure? And the encoding format?

You could easily create a list that show nothing but the sorted filename with all the path information.
I hope that most of the information is also stored in the tags and not only in the filenames... as probably you will get problems with names like Antonín Dvořák, Elīna Garanča and others with non-ascii characters in the name.
I think that the filename is mainly something that you need and that may be added so that you find the file in your system - other users will probably look for the TITLE or ALBUM.
So perhaps an export that loops by artist,album, and then titles is just as good.

True the recipients do not need my file structure or encoding format.
Yes, most of the information is in the tags.
I did the export with artist, album, title and then also the path (for my use only). I guess I can live with the path name and not have to break it out into levels.
Your advice has been very useful. Making me think of what I really need to do.

Is this what you are looking for?

I've used since 2005 "Directory Lister v0.9" which is free. Newer than 0.9 it's costs, I believe. This is how I go about it with V0.9 and I'm sure tag will also give you an output that will look like "\folder\folder\folder\etc.\filename.ext", as a text file or csv, but in lister go for a txt file as this will give you, file path and name for each file in each line of text. Which if you import to excel (or similar) using the text delimiter , will give you a column for each directory and the last column for the filename.

Oh and v0.9 may not be keen on unicode.

If this is what your after you could just use the cmd prompt ...

Open a cmd prompt at the starting (Top) folder and type dir /b /s > yourlist.txt or in a windows powershell type cmd /r dir /b /s > yourfilelist.txt

And import yourfilelist.txt to excel.

If I've miss-interpreted your query, sorry.

You understood what I was asking.
I'll look into Directory Lister. Thank you.

If you can't find it, pm me.

I downloaded a trial version of the current version of Directory Lister. It was easy to use, Alas, I do not see any way to get all the path information on a line in separate fields. It seems that the trial version does not allow music tag data to be shown. Plus it crashed at the end when I tried to change my directories.
I will see if I can find more about this before giving up. It is nice software and might be useful for me later when I organize my photos.

This might be useful for your photos.....

Reply

Oh, tags as well! Sorry I was concentrating on the files.

In Mp3tag, try exporting your list with %_path% as the very last column with everything else you want first. As I'm not sure what mess you would get placing it anywhere else and my curiosity isn't getting the better of me at this time of night to find out.

e.g.
$filename(txt)$loop(%_path%)%_filename_ext%\%track%\%artist%\%title%\%album%\%_length_seconds%\%genre%\%_path% $loopend()

Import this into excel using \ as the delimiter. Hopefully you'll get what I get which is seven columns plus columns starting with your drive letter, then a column for each directory and finely the filename.

You can use %_folderpath% and you will not get the filename in the last column.

In my example you can change all of the \ to what ever like, but you will end up with a few more steps. If using - instead of . You will need to import your file with the delimiter - and then once in excel, highlight the last column which will have the full path and (filename if using), then do a convert text to columns.

Anyway have a play and come back if it all goes tits up for you.

Regards Ian.

Oh and if I could remember how to get it to output column headings too that would be useful.

Yep.
I've been doing the path as the first and as the last columns. I "text to columns" (with \ delimiter) on the ending path column. Having the path at the beginning makes sorting easy, and I'll eventually delete it.
"Text to columns" is one of my favorite functions.

To make things easier, I am narrowing the number of folders I work on at one time. If they are similar they tend to have the same number of subfolders.

I pretty much have the procedure down, and I know how to fix the problems (example: stray semicolons in file names).

Stay safe.

:thought_balloon:Brilliant.