Back to Code & Script Bits Back to chipwork.com
 
...I'll name that tune in ASP (2).
Garbage in, along with The Dandy Warhols and Lou Reed.
 
Step 1
No ASP yet, just preparation.
You might like to start by following any popular naming convention for the filenames of your mp3s, like "Artist Name - Song Name.mp3". No apostrophes if you want to keep things simple when you handle the names as strings later on. There is freeware/shareware available that can speed up this task considerably, I'm using The Rename.
Store the files in a directory stucture of your choice using the names of artists, albums and movie sountracks as directory names. Throughout the storing and naming process use only alphanumeric characters, spaces, underscores and brackets.

...Then
Choices.
I have to say I have become dependent on a Perl method of listing directories to text files because while it's listing files, a new "index of artists" page can be generated for the "body" frame of the front page.
However, here's the alternative DOS method I started with originally...

The DOS (simplest) Way
From the root of your MP3 directory tree type:

DIR /S > MP3.TXT

...and produce an accurate text file of all the track names and their paths.
Open it in any text editor and save it with a new name, then do some
searching and replacing.
Things like:
Volume in drive E is MP3_1
Volume Serial Number is 08F5-1C2D
...and
Directory of E:\60s Plus
...and
.    <DIR> 15/10/00 6:46 .
..   <DIR> 15/10/00 6:46 ..
...leaving one long continuous list that has this format:
GARBAG~3 MP3  3,580,365  15/10/00  22:33 Garbage - Wicked Ways.mp3
GARBAG~4 MP3  3,881,295  15/10/00  22:33 Garbage - Push It.mp3
GARBA~10 MP3  3,577,857  15/10/00  22:33 Garbage - Special.mp3

This list can be imported into a spreadsheet app and have the columns you don't want removed. Create a list with just 'Artist' and 'Title' columns, no ' - ' seperator or '.mp3' extensions. Add the 'Location' column and paste the path from the original directory listing for each group or gategory, (there will be as many paste operations as there are directories).
It should end up like this:
Spreadsheet screenshot
When you're happy save the sheet.

Import the spreadsheet into your DB app and save it. This is the basic database to be maintained and added to as your collection grows. You might want to develop more functionality, like adding notes, dates and cross-references but for now you just need a database to read from an ASP page.
Make this file a DSN via the Windows Control Panel, ODBC Data Sourses (32bit) applet and you're ready to access it in your pages. This DOS listing may be a little slow but it's an excellent way of becoming very familiar with your own collection's specific needs before moving on to a scripted method.

    As my own collection grew, I changed to a PERL method of creating the formatted CSV list, (which works from within MS Access). This method creates a fresh "live" list each time, but means no other data can be stored in the table.
  • 1st) The Perl script is run to create the list.
  • 2nd) A macro in MS Access is activated which deletes the entire MP3 table.
  • 3rd) Then the macro copies an empty duplicate MP3 table and gives it the same name as the deleted one.
  • 4th) The same macro then imports the CSV text file to the newly prepared MP3 table.

Previous | Next

Back to chipwork.com.