Windows 8 and 8.1 Forums


how can I find files w/same first 10 characters in name?

  1. #1


    Posts : 22
    Windows 7 home x64

    how can I find files w/same first 10 characters in name?


    Hello everyone,

    I have a lot of files who are stored into folders (~ 2-3K worth of folders with 2-20 files in each folder) and I need to search in each one to see if there are any files that are similar in name. None will be exactly the same so I need to only compare the first 10 characters and if there are 2 files that have the same characters, then I need to have them displayed so I can decide if I should delete one. The problem with commercial duplicate detectors is they match the entire name or the CRC of a file which in this case will be different. Any help is appreciated.

    -S

      My System SpecsSystem Spec

  2. #2


    Posts : 2,191
    Windows 8.1


    Windows 8 Power Shell has the ability to do all that you require and more:

    Select-String
      My System SpecsSystem Spec

  3. #3


    Posts : 22
    Windows 7 home x64


    Thanks my2cents. You are correct that powershell can do a lot, however it is a lot overwhelming for my level of scripting. The examples that I see usually are looking at a text file for instances of a pattern, where I need a more complex pattern. I need to compare every file against every other file and if any of them have the same first 10 characters, capture them to an output I can read to decide which to delete.

    This example is the closest I could find that searches file names

    PS C:\> get-childitem c:\windows\system32\*.txt -recurse | select-string -pattern "Microsoft" -casesensitiveAny thoughts on how to use select-string to do a comparison between files, not for a specific pattern?Thanks-S
      My System SpecsSystem Spec

  4. #4


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7


    Can't you make a Search String with Wildcards in it, for instance searching for IMG*.png or IMG?.png?

    We used to be able to do that kind of stuff in Windows 98 and XP
      My System SpecsSystem Spec

  5. #5


    Posts : 22
    Windows 7 home x64


    Let me expand on my issue. I have a hard drive with a lot of media files on it (avi,mkv,mp4,etc). Currently the file structure is to have the title of the media file on a folder with the associated media inside the folder. For example

    Folder titled
    2001 A Space Odyssey (1968) [tt0062622]


    Files within folder
    2001 A Space Odyssey (1968) [tt0062622].[720p].[1280x576].[XviD].[AC3].[6ch].[HDDVD].avi

    Some of these folders have different versions of the media (different resolution, different encoding,different containers) and they also have supporting files (jpgs, .nfo, .svt, .sub) within the folder.

    I need to write a script that will look at all the files of my drive and if similar files are found, generate a list of these so I can decide if I want to keep the similar files. If these were just duplicates, I could use an exact file name match or CRC comparison offered by most free duplicate detector software, but because only the name of the media (movie title) is the same and the rest of the file name is different (because it lists aspects of the media such as resolution, codec format, etc) I need another way to compare these files.

    I could create a script that has the search of "2001 A Space Odyssey*" but this would only be good for 1 folder. I have 2632 folders each with a different movie in them.

    Hope this help clarify my issue and thank you for any help you can give me.

    -S
      My System SpecsSystem Spec

  6. #6


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7
      My System SpecsSystem Spec

  7. #7


    Posts : 22
    Windows 7 home x64


    I really appreciate you help, but I don't think I have stated what I need correctly. Let me try again.

    I need to find movie files that are the same movie, make a list of these same movie files so I can decide if I want to keep both of them. These "duplicate" movie files will NOT have the same container, size, CRC, or exactly same file name.

    So if I were to just find video files, this would not find duplicates based on title. The power shell solution also relies on windows def of Kind=video which does not include .mkv files or .ogg files.
      My System SpecsSystem Spec

  8. #8


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7


    You mean, if they are the exact same item but marked differently or in a different format opr resolution. I know what you want, I just can't think of a way to do it. The Powershell thing will not break down the videos into subgroups of MKV, AVI, MOV, etc.

    I installed a Plex Server into one of my machines and I use that to sort out my libraries, it figures out what's in there, names it and even adds subtitles. It's not perfect, but it should find dupes of various resolutions and file types. The drawback with that is you have to add the folders one by one, it won't search through subfolders. But once it finds your content it usually puts the right name on it, unless it is named in such a way that the program can't figure it out. For instance, I have 4 seasons of a TV show that are named "S1E3,avi" etc, and the program needs more info to figure out what it is.

    But even with that, I've spent a lot of time sorting things out manually, I keep everything meticulously ordered by Content type, name, and resolution. My Library spans 3 PCs and about 2 and a half TB. When I find dupes I keep the best one and discard the rest. When I get something that has a name that does not describe what it is, I change it.

    People who mess with Apple Scripts are banging their head against this as well:

    https://discussions.apple.com/thread...art=0&tstart=0
      My System SpecsSystem Spec

  9. #9


    San Jose - California
    Posts : 2,847
    8.1x64PWMC Ubuntu14.04x64 MintMate17x64


    For what you are trying to do. I think you should look at a small freeware called: Everything Quick Search
    it is small (< 400 KB) and it supports regex pattern matching. I use it instead of Windows Search.
    Below is an example of how I search for shutdown.exe using pattern matching.
    ^ means starts with the word Shut
    .* means anything after Shut
    $ means ended with exe
    This is just to show you how pattern matching works. The simple way is just to type shutdown.exe and the result will give you the list of folders where the file(s) resided.

    Click image for larger version

    For more info & download from the link below:
    Everything Search Engine | PCWorld
      My System SpecsSystem Spec

  10. #10


    Adelaide
    Posts : 1,338
    Windows 7 Ultimate SP1 (64 bit), Linux Mint 17.1 MATE (64 bit)


    If it is just file names (not file contents) can't you just type the first 10 characters into the File Explorer search box (when you are browsing the parent folder)?
      My System SpecsSystem Spec

Page 1 of 3 123 LastLast
how can I find files w/same first 10 characters in name?
Related Threads
I still can't figure out this Windows 8 search function ... I have a bunch of text files and I need to search for the following string for example within the files: now() Can anyone tell me what I need to do to search for this string? It seems like Windows 8 ignores just about all...
Windows 8.1 64b Some files, when open with notepad, can be easily read in English. For other ones, I get characters like the ones bellow. How could I read these characters, is there any online translator for this? or I should learn basic C++ or other means? Many thanks <J#wH=WM...
This is my first time on the forum. I have been using a PC for over ten years and, at best, I am still a novice! I am experiencing a lot of issues I had overcome with Win7. I will address thes one at a time. In the past when I was looking for a folder or file I pressed START and keyed in what...
I'm trying to download some DLLs to use for my Paint Shop Pro program and I need to put them in my System 32 files, and I can't find System 32. I new at working with this Win 8 so please be gentle with me. I received the 2 dlls in a zip folder. I opened them and saved in a folder in Documents. I...
Hi everyone, im new here and in need of help. I recently purchased a new laptop (Windows 8), we put the hard disk from my old slow laptop (win XP) that stopped working into a "sata enclosure". When I attached it, I cant find my personal files. Its like the space is taken up but my important...
Hi my dad upgraded from windows 7 to 8 a few months ago and selected to keep his old files (i.e. pictures, vids, so on) now we cant find his old files. I have gone to the windows.old file and there are files there but they all say that they are empty. everything else seems to be fine but we cant...
Where do I find app .exe files? in Software and Apps
I have a Logitech keyboard with shortcuts. I wanted to link the search button to the Google Search app via the Logitech Setpoint software. Normal I can assign programs to keys by navigating to its exe file. Does such a thing exist for apps from the store?
Eight Forums Android App Eight Forums IOS App Follow us on Facebook