by Luuk » Fri Sep 23, 2022 8:33 am
Once the text-file is ready, can just use the menu... "Special, Character Translations".
Then to paste your whole file-contents into this window, for testing all of your removals.
Whem its finished, then "File, Save As" can save everything into a .bru settings-file for later.
For myself, I do just keep 1-file without any commas or equals, and just let the notepad++ convert it for my copy/pasting.
This because my notepad++ has a macro called BRU-Char-Trans, to auto-convert them, making it very easy to copy/paste.
The Rename-Pairs uses another format like Original-Name.doc|New-Name.doc, so its always wanting the whole filenames.
If you like to invent a similiar macro for notepad++, can use 2-regexs in this order...
^([^=\r\n]+)$
\1=
This to put '=' at the very end, when theres not any '=' somewhere on the line already.
([^=,\r\n])(?!([=,]|$))
\1,
This to put commas anywhere that might be needed.
So if you have an incomplete file, the whole macro will convert your lines like...
.abx.xyz ----------> .,a,b,x,.,x,y,z=
.abs.efg ----------> .,a,b,s,.,e,f,g=
.abc.efg ----------> .,a,b,c,.,e,f,g=
Rem,ove1 --------> R,e,m,o,v,e,1=
R,emove2 --------> R,e,m,o,v,e,2=
Remove,3= -------> R,e,m,o,v,e,3=
dogs=canines ----> d,o,g,s=c,a,n,i,n,e,s
c,ats=felines -----> c,a,t,s=f,e,l,i,n,e,s
Replace1=With1 -> R,e,p,l,a,c,e,1=W,i,t,h,1
So lines without '=' will be converted into removals by adding '=' to the end, and then it just comma-separates the rest.
To create this macro, can use "Macro, Start Recording", then type the 1st Find and Replace, and then click "Replace All".
Then just type the 2nd Find and Replace, and click "Replace All" again, and then use "Macro, Stop Recording".
This will let you save it with "Macro, Save Current Recorded Macro" and just give it any descriptive name.
The main things to remember about Char Translations, is that he is always case-sensitive, so you must include all possible matches!
And also should probably never use very short text-strings, because those text-strings might also be found inside of other words.
So like if you were using the above Char Translations, it would convert catsup ---> felinesup.
So very short-strings are safer inside of RegEx(1) with negative look-arounds, and use Character Translations for the rest.
Both of them will always be saved inside of your .bru settings-file anyways, when using the menu "File, Save As".
If needing help to convert anything for RegEx(1), can just post some examples and I will try.
If needing to replace any commas or '=', they first have to be converted into 2c or 3d before comma-separating.
So I would just put those replacements into either Replace(3) or RegEx(1), so then not having to edit the macro.