Author Topic: Search for space in filename does not seem to work.  (Read 1824 times)

Offline mike999

  • Newcomer
  • *
  • Posts: 37
    • View Profile
Search for space in filename does not seem to work.
« on: January 22, 2021, 06:02:25 AM »
Search for space in filename does not seem to work. Have tried filename " " which seems to be the correct syntax but it brings back thousands of files that don't have a space in the filename.  Trying the same syntax for other things in filename does seem to work. So how to get those files with a space in the filename (as I want to replace them with an underscore).
I did it by brute force on some folders by extracting the filenames to an excel file and getting them there but this is a very long way round, there must be a way to do it in PM6plus.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24764
    • View Profile
    • Camera Bits, Inc.
Re: Search for space in filename does not seem to work.
« Reply #1 on: January 22, 2021, 08:57:47 AM »
Search for space in filename does not seem to work. Have tried filename " " which seems to be the correct syntax but it brings back thousands of files that don't have a space in the filename.  Trying the same syntax for other things in filename does seem to work. So how to get those files with a space in the filename (as I want to replace them with an underscore).
I did it by brute force on some folders by extracting the filenames to an excel file and getting them there but this is a very long way round, there must be a way to do it in PM6plus.

Searching for spaces is not possible due to how the full-text engine works.  You could search for all files ("") and then use the Find and Replace panel like in the image below.

HTH,

-Kirk

Offline mike999

  • Newcomer
  • *
  • Posts: 37
    • View Profile
Re: Search for space in filename does not seem to work.
« Reply #2 on: January 22, 2021, 10:13:37 AM »
Just checking it is brackets with a space inside followed by a plus sign.

Then it has to work on filename but does Grep and case sensitive search also need to be ticked, don't want to cause havoc in hundreds of thousands of files by making a mistake here.

Actually I have just found some filenames that have a space at the beginning and the suggested find and replace shown above did not work, does it only work in other positions in the name?  Sorry for writing this in real time tried again and this time ticked all those other boxes for 'case sensitive', 'grep' and 'treat repeating fields as single string' and this time it did work - why?
« Last Edit: January 22, 2021, 10:30:06 AM by mike999 »

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24764
    • View Profile
    • Camera Bits, Inc.
Re: Search for space in filename does not seem to work.
« Reply #3 on: January 22, 2021, 10:22:57 AM »
Mike,

Just checking it is brackets with a space inside followed by a plus sign.

Open parenthesis, space, close parenthesis, plus sign.  Square brackets will also work.

Then it has to work on filename but does Grep and case sensitive search also need to be ticked, don't want to cause havoc in hundreds of thousands of files by making a mistake here.

Do a trial run:  Select a few images.  Then change the In: popup menu to "Selected items" and do the Replace.  If it works fine then you can have it operate on all images.  You could also continue to select a few hundred at a time and proceed through them if you want.

-Kirk