Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #9923
    user
    Participant

    hello!

    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!

    #9925
    ToadLoadin
    Member

    Hi,

    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! :-)

    #9933
    Yutaka Emura
    Keymaster

    Hi 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!

    #9939
    user
    Participant

    thanks, 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?

    #9942
    Yutaka Emura
    Keymaster

    Hi 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!

    #9968
    user
    Participant

    can 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!

    #9973
    Yutaka Emura
    Keymaster

    Hello,

    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,

    #10023
    user
    Participant

    it seems to work very well, thanks!

    but how do I specify the case-sensitive action?

    #10024
    ToadLoadin
    Member

    I guess while recording the macro, if you turned case sensitive on, it will also be recored into the macro code.

    #10097
    ldm
    Participant

    Hi 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!

    #10100
    pja
    Participant

    Yutaka,

    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 :-D

    #10102
    ldm
    Participant

    Any help for removing characters using JavaScript?

    #10103
    ToadLoadin
    Member

    You can find it here.

    #10104
    ldm
    Participant

    Thank you!

    Now how is it possible to remove double (or more) empty lines?

    Thank you again for any response!

    #10105
    ToadLoadin
    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;
    #10106
    ToadLoadin
    Member

    I 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…

    #10107
    ldm
    Participant

    Peter ,

    Wanna to share your code?

Viewing 17 posts - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.