1 (edited by Stefan 2013-03-25 17:43:51)

Topic: "File > Preferences > Characters" replace EVERY with ONE

Just a idea from my tests. No real wish.



For "File > Preferences > Characters ==> Characters to replace"

it is troublesomely to enter exactly as many replacement sings as sings to replace.


E.g:
From: !#$()+,-;=@[]_{}~
To: _________________

i have to enter 17 underscores too.



Here i would suggest to add a check box like

From: [ !#$()+,-;=@[]_{}~                                         ]
To:     [ _                                                                     ]
"[X] Replace every "From" sign with the same single sign from "To" field"


which limits the "To" box to an single char if checked.


Make sense ;-) ?
.

Re: "File > Preferences > Characters" replace EVERY with ONE

I'll have a look at this.
Thanks.

Re: "File > Preferences > Characters" replace EVERY with ONE

A "simple" solution can be to allow the "To" string to be smaller than the "From" string,
the last "To" character being used for the out of bound "From" ones.

For example :
From : abcdefghij
To : 12_

d,e,f,g,h,i and j will be replaced by the last character of "To" : _

"derobade" giving "__ro21__"

Too geeky maybe ?

Re: "File > Preferences > Characters" replace EVERY with ONE

Thinking about it the whole afternoon.
First i thought, to geeky, yes. But now I think it's fine.

FROM
TO
RESULT

F: ABCDE
T: 12345
R: 12345

F: ABCDE
T: 12345678
R: 12345

F: ABCDE
T: 1234
R: 12344

F: ABCDE
T: 123
R: 12333

F: ABCDE
T: 12
R: 12222

F: ABCDE
T: 1
R: 11111

F: !#$()+,-;=@[]_{}~
T: _
R: _________________


Lets see what the user get:
1 - same To amount = every item is replaced on its own
2 - lesser To amount = first items are replaced on it own, remaining items are replaced with same sign
3- single To = every item is replaced with same sign
4 - more To then From = additives are silently dropped

For 2, the user may wonder or even worser, gets unwanted result.
So I think the idea is fine, but you should maybe still show a warning message like
"Attention: you have entered %s From but %s To. Are you sure?"
"Attention: you have entered less To (%s) then From (%s). Some or all From will get same To sign. Are you sure?"
"Attention: you have entered more To (%s) then From (%s). The additive will be ignored . Are you sure?"

.

Re: "File > Preferences > Characters" replace EVERY with ONE

An interrupting information message might be annoying.
For now I've added a text indicating the "translations" done : a -> 1, b ->2, cdefghij -> _

Re: "File > Preferences > Characters" replace EVERY with ONE

Siren 3.12 beta 2 build 954 includes this new feature.
Comments are welcome.

7 (edited by Stefan 2013-04-09 21:20:05)

Re: "File > Preferences > Characters" replace EVERY with ONE

He Rémi, great idea  big_smile
Intuitive and works well.
Fine with the tool tips!
Well done. Good work.

And it works
(UNDO works too, btw)

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! 2A 3B 4C 5D 6E 7F 8G 9. 0H 1I 2J 3L 4M 5N 6O 7P.txt
USE:
"File > Preferences > Characters ==> Characters to replace"
From: #$()+,-;=@[]_{}~
To:ABCDEFGHIJKLMNOP
Expression: %f

---

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! 2A 3B 4C 5D 6E 7F 8F 9. 0F 1F 2F 3F 4F 5F 6F 7F.txt
USE:
"File > Preferences > Characters ==> Characters to replace"
From: #$()+,-;=@[]_{}~
To:ABCDEF
Expression: %f




http://img818.imageshack.us/img818/9004/sirenrenamerchartorepla.png


.

Re: "File > Preferences > Characters" replace EVERY with ONE

Thanks Stefan !