Character Translations How-To

Bulk Rename Utility How-To's

Character Translations How-To

Postby Stefan » Wed Mar 16, 2011 8:40 am

Hi there,

i had some time and looked at this issue again, and i found out

Character Translations ("Options > Character Translations... Strg+F6)

is a real "Character Translations"

and NOT a "String Translations".


That means,
If you want to replace ONE with THREE
you can NOT use simple ONE=THREE
but do it char by char like O,N,E=T,H,R,E,E



Examples:
(Note: use this without the quote "" signs)

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

Replace an group of signs or one sign with an another sign or group:
"A=F,i,r,s,t"
"B=S,e,c,o,n,d"
"J,a,n=0,1"
"F,e,b=0,2"
...
"N,o,v=1,1"
"D,e,c=1,2"
"I,M=P,O,X,Y,Z" > IMG_0001.jpg >> POXYZYG_0001.jpg
"0,0,5=V"
"0,0,6=V,I"
"0,0,7=V,I,I"
"0,0,8=V,I,I,I"

Translit german umlautes:
"Ü=U,e"
"ü=u,e"
"Ö=O,e"
"ö=o,e"
"Ä=A,e"
"ä=a,e"
"ß=s,s"


Shorten file names:
f,e,a,t,u,r,i,n,g=f,e,a,t
B,u,l,k,R,e,n,a,m,e,U,t,i,l,i,t,y=B,R,U
R,e,m,i,x=R,M,X
R,e,m,a,s,t,e,r,e,d=R,E,M
R,a,d,i,o,V,e,r,s,i,o,n=R,a,V
I,m,p,o,r,t,a,n,t=!
V,e,r,y, ,I,m,p,o,r,t,a,n,t=!,!,!
2,0,1,3=1,3


BRU > Help > Character Translations
Code: Select all
Character Translations allows you to enter a specific character or sequence of characters,
and have that translated into a different character or sequence of characters.
So for example, you could specify that you always want a $ sign to be converted into the word DOLLAR.

$=D,O,L,L,A,R

Or vise versa:
D,O,L,L,A,R=$



There are three ways to enter the replacement data:
1. As a character, e.g. A   (or an digit, e.g. 8)
2. As a hex value, e.g. 0F
3. As a decimal value, e.g. 065

Bulk Rename Utility identifies the type of value entered by its length.
So if your value is one character long (e.g. A or 1) then it's a direct character;
two characters long (e.g. 6F) its a hex value;
three characters long (e.g. 017) its a decimal value.
That way you can perform replacements of non-keyboard characters.

Separate the FROM and the TO conversions with an equals sign.  ( X=U )
If you wish to actually convert an equals sign  to/from something else
then you can specify the hex (3D) or decimal value (61) for the equals sign in your rules.
If you wish to actually convert a comma sign to/from something else
then you can specify the hex (2C) or decimal value (44) for the comma sign in your rules.


In the following examples, every example is converting a capital "A" to a capital "B"

· A=B (direct expression of the characters to convert)
· 41=42 (two character long, therefore hex values)
· 065=066 (three characters long, therefore decimal values)
· A=066 (using a mixture of the above)
· 41=066 (using a mixture of the above)


If you wish to to convert several characters then you can separate the values by commas.
So the following example will convert ABC to DEF:

· 41,066,C=D,E,070
or
· A,B,C=D,E,F



To make it more clear:
If your value on either side of the equal sign
is one character long (e.g. "A" or "1") then it's a literal character, (see "Value" column for examples);
if two characters long (e.g. "6F") its automatically interpreted as a hex value, (see "Hex" column);
if three characters long (e.g. "017") its taken as a decimal value, (see "Decimal" column).
ASCII Char Table (example)
Code: Select all
Decimal    Hex    Value (meaning)
-------    ---    ------------
  032      20     SP    (Space)
  033      21      !    (exclamation mark)
  034      22      "    (double quote)
  035      23      #    (number sign)
  036      24      $    (dollar sign)
  040      28      (    (left/open parenthesis)
  041      29      )    (right/closing parenth.)
  043      2B      +    (plus)
  044      2C      ,    (comma)
  045      2D      -    (minus or dash)
  046      2E      .    (dot)
  048      30      0
  049      31      1
  057      39      9
  059      3B      ;    (semi-colon)
  061      3D      =    (equal sign)
  064      40      @    (AT symbol)
  065      41      A
  066      42      B
  067      43      C
  088      58      X
  089      59      Y
  090      5A      Z
  091      5B      [    (left/opening bracket)
  092      5C      \    (back slash)
  093      5D      ]    (right/closing bracket)
  095      5F      _    (underscore)
  097      61      a
  098      62      b
  099      63      c
  122      7A      z
  123      7B      {    (left/opening brace)
  125      7D      }    (right/closing brace)
  126      7E      ~    (tilde)


For more information just google for "ASCII Char Table"
http://www.google.de/search?hl=de&source=hp&q=ascii+table&btnG=Google-Suche
http://www.ascii-code.com/

- - -


Store settings
Please note that BRU don't save settings so you may have to save this definitions yourself in an text file for later re-use!
Best use an good text editor to collect this replacing groups and store this as plain text file in your BRU-folder.
Next if you want to use this definitions, open this text file, select all, copy to clipboard, go to BRU, press CTRL+F6 and paste it in.

OTOH you can use "File > Save" or "Save as..." to an *.bru file so this definition is saved too with all other current settings.
But then it is every time active when you start BRU.
See "*.bru favorites" for more >>> http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=4&t=1220&p=3482&hilit=default.bru#p3482

Disable Character Translations
Post by mick01 » 06 Aug 2014, 06:41
Is there a way to turn Character Translations on & off easily without deleting the list when it is not required & reading the list when it is required?
Post by Stefan » 08 Aug 2014, 23:15
I don't think so. I would probably just temporarily rename the .bru file so it is not found by BRU...

- - -



NOTE: If you copy&paste this be sure there are no trailing blanks!
You can check this by selecting this list in the "Character Translations"-dialog in BRU and check if the blue selection end right after the chars!
Test it here in the code box below where i have put in a few spaces behind the V's so you see what i mean:
Roman Numerals Translation List (example)
Code: Select all
0,0,1=I
0,0,2=I,I
0,0,3=I,I,I
0,0,4=I,V   
0,0,5=V   
0,0,6=V,I
0,0,7=V,I,I
0,0,8=V,I,I,I
0,0,9=I,X
0,1,0=X
0,9,8=X,C,V,I,I,I

Again: There must be no blue colored space behind the last char!!!
And between each sign there must be one coma!


If one is interested, there are more posts from Jim about Character Translations where i have learned this:
http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=3&t=300
http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=3&t=666&p=2439


HTH? :D

#######################################################

Use Character Translations to remove Symbols

FROM:
Test File 1! 2# 3$ 4( 5) 6+ 7, 8- 9. 0; 1= 2@ 3] 4_ 5{ 6} 7~.txt
TO:
Test File 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7.txt


To remove symbols you can utilize "Remove(5) [X] Sym.

To have more control over which symbols gets removed and which not,
you can utilize "Character Translations" with a list like this:
Code: Select all
!=
#=
$=
(=
)=
+=
-=
.=
;=
@=
]=
_=
{=
}=
~=
2C=
3D=


All symbol signs are replaced with nothing: '!=', i.e. they gets "removed".
You can also write an space behind the equal sign '=' to replace by an blank: '!= '
or e.g. by an underscore: '!=_'


For example, to keep e.g. the underscore (_) and hyphen (-) in the file names,
like TO: Test File 1 2 3 4 5 6 7 8- 9 0 1 2 3 4_ 5 6 7.txt
just remove the corresponding lines '-=' and '-=' from the above list.


Note: since comma and equal sign are used by the Character Translations function itself,
we have to mask them by using HEX (or the decimal) notation here instead:
Code: Select all
    Decimal    Hex    Value (means)
    -------    ---    ------------
      043      2B      +    (plus)
      044      2C      ,    (comma)
      059      3B      ;    (semi-colon)
      061      3D      =    (equal sign)
      064      40      @    (AT symbol)




- - -

Replace Symbols by underscore (To replace by a space, just add a space instead a underscore. Or what you like):
!=_
-=_
#=_
$=_
%=_
'=_
(=_
)=_
[=_
]=_
{=_
}=_
~=_
+=_
2C=_
;=_
3D=_
@=_

Note the HEX notation for comma and equal sign. ( comma=2C , equal sign=3D)


#######################################################


Use Character Translations for URL encoded files decoding
(Percent-encoding >> http://en.wikipedia.org/wiki/Percent-encoding)

%,2,0=
%,2,1=!
%,2,3=#
%,2,4=$
%,2,5=%
%,2,6=&
%,2,7='
%,2,8=(
%,2,9=)
%,2,B=+
%,2,C=,
%,5,B=[
%,5,D=]


- - -
_
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Character Translations HowTo

Postby Stefan » Tue Dec 15, 2015 8:27 am

 
I can't edit my posts anymore, to update my FAQs post :x


- - -

Create your own "Character Translations" list:
 
FROM:
Building=Bldg
Earthworks=EW
partners=Part

TO:
B,u,i,l,d,i,n,g,=,B,l,d,g,
E,a,r,t,h,w,o,r,k,s,=,E,W,
p,a,r,t,n,e,r,s,=,P,a,r,t,

USE e.g. EmEditor RegEx S&R:
Search: (.)
Replace: \1,
[X]RegEx

Clean up the result to:
B,u,i,l,d,i,n,g=B,l,d,g
E,a,r,t,h,w,o,r,k,s=E,W
p,a,r,t,n,e,r,s=P,a,r,t



Open "Options > Character Translations... (Strg+F6) and paste that table in:
B,u,i,l,d,i,n,g=B,l,d,g
E,a,r,t,h,w,o,r,k,s=E,W
p,a,r,t,n,e,r,s=P,a,r,t



Please note that BRU only save this translation table to the *.bru file, if you save the whole settings via "File > Save".
So you may want to save this definitions yourself into a text file for later re-use if you don't want to save the other settings too the same way?
Of course you can save different settings to different *.bru files, if you want, though.




- - -


 
Last edited by Stefan on Tue Dec 15, 2015 12:43 pm, edited 2 times in total.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Character Translations HowTo

Postby Admin » Tue Dec 15, 2015 9:23 am

Hi Stefan,

I thought the
character translations
are saved in the BRU file?

thanks
Admin
Site Admin
 
Posts: 2341
Joined: Tue Mar 08, 2005 8:39 pm

Re: Character Translations HowTo

Postby Johnny27 » Fri Jun 22, 2018 8:29 pm

Excellent article and great information! Thanks!

I still have one thing I can't get to work: Getting rid of a non-breaking-space in a file name. For some reason, the BRC Utility won't take it out no matter how I tell it what to look for. I've tried ASCII, HEX, OCT, HTML Number, and copy-and-paste but nothing works. In BRU, a copy-and-paste works fine, but I'd sure like to be able to compile all my change requests into one quick file to execute and clean up everything at once.

Any ideas appreciated. Love your utility by the way and thanks for providing it!!
Johnny27
 
Posts: 9
Joined: Sat Sep 02, 2017 10:55 pm

Re: Character Translations How-To

Postby scampbll » Wed Nov 01, 2023 7:38 pm

Is there any way to make character translations only replace at the beginning of a name? I have a list of two letter codes that I'm trying to translate, but only at the beginning. Sometimes the file name has the same character sequence elsewhere, which causes confusion.

Thanks!
scampbll
 
Posts: 3
Joined: Fri Oct 20, 2023 7:00 pm

Re: Character Translations How-To

Postby Admin » Thu Nov 02, 2023 2:09 am

How many entries do you have in the list? Maybe you could use Replace (3) instead, where you can specify \first\ and do multiple replacements.
Admin
Site Admin
 
Posts: 2341
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To