0

I want to be able to isolate and search using the windows DIR command for only the files that contain an extra numeric at the end. How do I do this? I have attached a picture that shows an example of one of my directories the link is below at the end.

"Track 01 1.m4a" and some are named "Track 01.m4a"? How can I list just the ones that were added with the numeric at the end? Also while we are at it? I have multiple duplicates sometimes 4 or five so I'm expecting to have to search for files with a range of numbers like "* [1-4].m4a"

If I can be clearer in my question please ask.

List of files:

enter image description here

1
dir /b | findstr

will let you do what you want to do.

  • Thx ymar, my understanding is dir is sending its output to findstr where I can use better searching commands. Correct? – Dr. Dan Jul 4 '16 at 22:36
  • What if next I want to delete those files I just searched for? – Dr. Dan Jul 4 '16 at 22:38
  • @DanielMiladinovich You can do something like dir /b | findstr /r /c:"[0-9] [0-9].m4a" This will display all the files that have the pattern digit-space-digit.m4a in them. Unfortunately, to delete these files, you might have to use a FOR loop. – Michał Masny Jul 4 '16 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.