- AuthorPosts
- February 3, 2012 at 1:04 pm #9923
user
Participanthello!
I currently work with turkish text and I need an automatic way to convert all special turkish characters into their corresponding english/latin characters
because I often work with other than english languages that have special characters, I need a way to convert them to their english/latin character analogue
but for now, a solution for turkish?
thanks!
February 3, 2012 at 3:03 pm #9925ToadLoadin
MemberHi,
I guess it could be done by macro:
– start “record macro”,
– replace one special character to the corresponding latin character (replace all)
– stop record
– “edit” the macro recored, copy all code generated by emeditor and paste it else where.
– repeat the procedure above with each special character you want to replace, except append the generated macro code to the first one.
– save the cumulated code to a single macro, put it in toolbar or asign it a short-cut key.Best regards! :-)
February 3, 2012 at 6:57 pm #9933Yutaka Emura
KeymasterHi user,
As ToadLoadin mentioned, you can use a macro to do this.
Also, you can use the Batch Replace feature of EmEditor Professional 11 to do this task easily.
http://www.emeditor.com/modules/feature1/rewrite/tc_39.html#batch_replace
Thanks!
February 3, 2012 at 7:11 pm #9939user
Participantthanks, I will try macro, but I am interested in batch replace too
however, is it possible to save a specific batch and run it by clicking a button in the toolbar?
February 3, 2012 at 7:19 pm #9942Yutaka Emura
KeymasterHi user,
Unfortunately, it is not easy to create a button from a batch you create from the Batch Replace feature. I might think about exporting as a macro from the Batch Replace dialog in future versions. Thanks!
February 7, 2012 at 9:21 am #9968user
Participantcan anyone write a JS script or something that will do these replaces with a click of a button?
i for ı
g for ğ
s for ş
c for ç
u for ü
o for öcase sensitive, in all document, every instance
thanks!
February 7, 2012 at 5:08 pm #9973Yutaka Emura
KeymasterHello,
You could actually record a macro while doing the batch replace.
The actual script will look like:
document.selection.Replace("a","b",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceQuiet);
document.selection.Replace("c","d",eeFindNext | eeFindSaveHistory | eeFindReplaceEscSeq | eeReplaceAll | eeFindReplaceQuiet);
...
Thanks,
February 16, 2012 at 10:50 am #10023user
Participantit seems to work very well, thanks!
but how do I specify the case-sensitive action?
February 16, 2012 at 11:56 am #10024ToadLoadin
MemberI guess while recording the macro, if you turned case sensitive on, it will also be recored into the macro code.
March 1, 2012 at 6:54 pm #10097ldm
ParticipantHi all,
1) What command should be used for removing a character?
2) How to replace double (or more) empty lines with a single empty line?
Thank you!
March 3, 2012 at 2:18 am #10100pja
ParticipantYutaka,
I have just used this technique to write a snippet/macro that changes curly quotes (single and double), sort and long dashes into their equivalent keyboard characters.
In the past I have had to do this as a series of “Find and Replace” tasks. Now its a simple highlight the text and click on the snippet.
Thank you very much for the tip.
Regards,
Peter :-DMarch 3, 2012 at 9:10 am #10102ldm
ParticipantAny help for removing characters using JavaScript?
March 3, 2012 at 12:01 pm #10103ToadLoadin
MemberYou can find it here.
March 3, 2012 at 12:47 pm #10104ldm
ParticipantThank you!
Now how is it possible to remove double (or more) empty lines?
Thank you again for any response!
March 3, 2012 at 1:57 pm #10105ToadLoadin
Member:-) I think it could be done with this macro:
// If nothing selected, select all.
var currentSelection = getSelection();
// A find'n replace using regular expression
// (in selected range only).
currentSelection.Replace("^s*$n", "", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
// earase search keyword highlighting.
document.HighlightFind = false;Then, you could use this macro to insert empty lines between each “none-empty” line (forgive my poor english):
// If nothing selected, select all.
var currentSelection = getSelection();
// A find'n replace using regular expression
// (in selected range only).
currentSelection.Replace("n", "nn", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
// earase search keyword highlighting.
document.HighlightFind = false;March 3, 2012 at 2:16 pm #10106ToadLoadin
MemberI just found that both of the two macro above is not perfect due to lack of checking the setting whether “regular expressions can match new line characters” or not…
March 3, 2012 at 4:30 pm #10107ldm
ParticipantPeter ,
Wanna to share your code?
- AuthorPosts
- You must be logged in to reply to this topic.