For all non-alphanumeric characters....

A swapping-ground for Regular Expression syntax

For all non-alphanumeric characters....

Postby rajames429 » Mon Mar 14, 2011 4:16 pm

I am running BRU 2.7.1.2 on Windows 7 64-bit.

I have hundreds of oddly named files, with all sorts of characters that I want to get rid of.

For my purposes, I want to get rid of any non-alphanumeric character in a file name. I want to leave the extensions as is.

Suppose I have a slew of Word docs ( *.doc )

When I placed [^a-zA-Z0-9_] in the match field and placed, say, "_" in the replace field, then BRU wants to name the file _.doc ( for example )

It wants to replace the entire filename with a "_" in any file with a non-alphanumeric character.

BRU then leaves any file name without a non-alphanumeric character alone.

I just want to replace every non-alphanumeric character with a "_" and leave the acceptable alphanumeric characters alone.
rajames429
 
Posts: 2
Joined: Mon Mar 14, 2011 4:08 pm

Re: For all non-alphanumeric characters....

Postby Stefan » Mon Mar 14, 2011 8:44 pm

I think RegEx won't work for this purpose since you have to match for all files common patterns.



Check out Remove(5):
[X]Sym.
[X]High
Chars[ ; , !) ( - _ # + . ü ö ä ]
<=="Note: use this without my spaces"





To replace signs use "Options > Character Translation..."

Examples:
"Note: use this without quote signs"

Replace signs with an space:
"(= "
"[= "
"!= "
or replace signs with an underscore:
"+=_"
";=_"
or replace signs with nothing (=remove):
"Ü="
"ü="
"Ö="
"ö="
"$="


See
Board index > Bulk Rename Utility > Suggestions > Roman Numeral Numbering
=> http://www.bulkrenameutility.co.uk/forum/viewtopic.php?p=3647#p3647



(Find me: get rid drop remove replace exchange signs non alpha numeric alphanumeric non-alphanumeric char chars character characters umlauts accent)
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: For all non-alphanumeric characters....

Postby rajames429 » Tue Mar 15, 2011 3:48 pm

Thank you Stefan, I used character translation and it worked great.

If anyone else needs the same functionality --> Remember to save the translations you define ( in a text file ) so that you can re-use them later.
rajames429
 
Posts: 2
Joined: Mon Mar 14, 2011 4:08 pm


Return to Regular Expressions