Page 1 of 1

"Keep Particular Characters" - can I run on entire drive?

Posted: 19 Mar 2015 17:16
by marvin_rock
Title sums it up pretty well, I want to run the "Keep Particular Characters" over an entire drive (a few million files), currently I'm doing a *.* search on each folder, then selecting all files, then doing it that way. Is there a quicker way of doing it?

Re: "Keep Particular Characters" - can I run on entire drive

Posted: 19 Mar 2015 17:50
by marvin_rock
Or possibly just run a search that shows me any files that have characters OTHER than "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 _-.()"

Re: "Keep Particular Characters" - can I run on entire drive

Posted: 19 Mar 2015 18:39
by admin
Just a quick shot: Try this search pattern, and ensure that this ticked: Configuration > Find Files & Branch View > Find Files > Enable extended pattern matching

Code: Select all

*[!a-zA-Z0-9 ._()-]*

Re: "Keep Particular Characters" - can I run on entire drive

Posted: 19 Mar 2015 18:58
by marvin_rock
admin wrote:Just a quick shot: Try this search pattern, and ensure that this ticked: Configuration > Find Files & Branch View > Find Files > Enable extended pattern matching

Code: Select all

*[!a-zA-Z0-9 ._()-]*
This seems to be working. I couldn't find that setting specifically, but it seems to be doing the trick, can you explain how that search patter works? Also, is there any way to add "&" into the search, I appear to be getting most of my hits from that symbol, which is okay for what I'm trying to do.

Re: "Keep Particular Characters" - can I run on entire drive

Posted: 19 Mar 2015 19:04
by admin

Code: Select all

*[!a-zA-Z0-9 ._()&-]*
The hyphen (-) should be the last in the list between [ and ].

[...] specifies a list of characters
! at the beginning means NOT
a-z = abcdef...z
A-Z = ABCDEF...Z
* is the usual wildcard

The whole means: Match any string that contains anywhere a char that is not in the list "a-zA-Z0-9 ._()&-".

Re: "Keep Particular Characters" - can I run on entire drive

Posted: 19 Mar 2015 19:10
by marvin_rock
Working perfect! Thanks!!!

Re: "Keep Particular Characters" - can I run on entire drive

Posted: 19 Mar 2015 19:33
by Marco
Or, you can try this regex pattern:

Code: Select all

[^\w \-.()]
where

Code: Select all

[  opens the character class
^  negates the content
\w the ASCII characters [A-Za-z0-9_], notice the inclusion of the underscore and digits
   the space
\- the hyphen, escaped
.  the dot
() the parentheses
]  closes the character class