Home Computer Audio Asylum

Music servers and other computer based digital audio technologies.

RE:results of inventory

That's a good point about the same music file name but different encodings. I had not thought of that.

Anyway, in the original powershell code I wrote to find all music files and insert their names and paths into my database, I ignored .mp3 files. I hate .mp3...


Querying my database now, I see there are more than 21,000 file names that have multiple physical copies scattered around my drives.

Below is the SQL in case you are interested, and a few rows from the results of the query.

----------------------------------------------------------------
select basename, count(filename) as FileCount from [FileInventory].[dbo].[f4] group by basename having count(filename) > 1
--------------------------------------------------------------

Filename PhysicalFileCount
-----------------------------------------------------------
(01)_Wild_World_-_Cat_Stevens- 7
(05) Think for Yourself - The Beatles 2
(06) The Kind Of Girl - The Zombies 4
(06)_Two_Fine_People_-_Cat_Stevens- 7


Below is the SQL query to now get from the database one single (arbitrarily chosen) path to any filename that has >1 physical copy on my drives.

The SQL ignores file type so it is unpredictable which file tape will be in the one path I retrieve for each filename. I don't think I care as long as they are lossless, which they all are.

-------------------------------------------------------------
with deduped as (select basename, min(id) as rowid,count(filename) as FileCount from [FileInventory].[dbo].[f4] group by basename having count(filename) > 1)
select allfiles.* from [FileInventory].[dbo].[f4] allfiles inner join deduped on allfiles.id = deduped.rowid
-------------------------------------------------------------













This post is made possible by the generous support of people like you and our sponsors:
  The Cable Cooker  


Follow Ups Full Thread
Follow Ups
  • RE:results of inventory - LtMandella 21:13:23 10/04/20 (0)

FAQ

Post a Message!

Forgot Password?
Moniker (Username):
Password (Optional):
  Remember my Moniker & Password  (What's this?)    Eat Me
E-Mail (Optional):
Subject:
Message:   (Posts are subject to Content Rules)
Optional Link URL:
Optional Link Title:
Optional Image URL:
Upload Image:
E-mail Replies:  Automagically notify you when someone responds.