Hello all,

As I have mentioned before, I have my entire (rather large) CD collection as mp3 on a linux server. I am trying to create a list of the contents in the order in which they were uploaded to the server from my ripping machine. As an aside, I'm doing this because I know that files in a certain date range have only version 1 id3 tags, while others have the date screwed up in the tag, etc.

ls -lag * gives me the correct output, which I redirect into a text file. Here's the problem:

How to actually get that list into some kind of delimited file with real date fields? Here's what the data looks like:

Allman Brothers Band:
total 240
drwxrwxr-x 25 501 501 4096 Feb 18 18:45 .
drwxrwxr-x 1010 501 501 24576 Feb 18 19:03 ..
drwxrwxr-x 2 501 501 4096 Jul 3 2001 A Decade of Hits 1969-1979
.
. (etc) more entries...
.
drwxrwxr-x 2 502 501 4096 Jan 20 2002 Eat A Peach
drwxrwxr-x 2 502 501 4096 Feb 18 18:44 Enlightened Rogues
drwxrwxr-x 2 501 501 4096 Aug 15 2001 Fillmore Concerts Disc 1
drwxrwxr-x 2 501 501 4096 Aug 15 2001 Fillmore Concerts Disc 2
drwxrwxr-x 2 502 501 4096 Feb 18 18:44 Hell & High Water
drwxrwxr-x 2 501 501 4096 Aug 15 2001 Live At The Ludlow Garage 1970 Disc 2
.
.
.
drwxrwxr-x 2 502 501 4096 Feb 18 18:45 Wipe the Windows, Check the Oil

Altan:
total 96
drwxrwxr-x 7 501 501 4096 Jan 17 2002 .
drwxrwxr-x 1010 501 501 24576 Feb 18 19:03 ..

You see, the date is actually 3 fixed-width fields, but if the date is this year, it puts the time instead of the date. The artist (parent directory) appears above with a ":" character at the end. There is a blank line before each new artist. The output I want is:

Artist, Album, Date

Where the Artist comes from the line above the contents the Album is the subdirectory name, and the Date is a usable reformatting of the 3 fixed width date fields. All of the other stuff, the blank lines and the . and .. lines need to be stripped.

By changing the system date on the machine, to 2004 for instance, I can eliminate the time vs. year problem, but I'm still having problems parsing this file.

Times like these I wish I knew perl. Can anyone rip this out off the top of their head?

Oh yeah, one last thing that helps is that the number right after the permisssions in the "." line contains the number of entries in that Artist subdirectory + 2 (+2 because . and .. both count as entries).

Thanks in advance,

Jim