In Reply to: RE:results of inventory posted by Rod M on October 4, 2020 at 20:08:21:
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:
Follow Ups
- RE:results of inventory - LtMandella 21:13:23 10/04/20 (0)