User Define Language Extensions - too many causes a crash, but not enough allowed



  • Hi All,

    I have several hundred log files that I would like to automatically be applied with a User Defined Language. The extension of the files range from .1 to .200, however, it would appear that you can only add a certain number of extension into the list box. I have tried editing the Userdefinedlanguage.xml file directly, but this simply case Notepad++ to crash.

    Is there a way to define a RegEx pattern to match?

    Cheers



  • @swinster

    UDL doesn’t understand RegEx yet. But I have provided a script solution here which could be modified
    to your needs.

    Cheers
    Claudia



  • Hey @Claudia-Frank,

    Thanks for the feedback. Having looked at the scripts, I believe that they could indeed be modified. I have tasked myself with understanding Python (for 2017), but the modification of the scripts shouldn’t be too much of a pain. I too use other scripts (PowerShell) to open various files so might need to look at some of the other modifications mentioned too.

    Cheers,

    Chris



  • @swinster

    Maybe it is also worth to create a issue at https://github.com/notepad-plus-plus/notepad-plus-plus/issues about the crashes you could create. Think that shouldn’t happen.



  • @cheg, sure will do, although user “intervention” in the XML might be seen as fiddling beyond reasonable control (although I suppose the exception should still be caught and handled).

    FWIW, if you manually keep adding extensions into the Extension box in the UDL dialogue, it will only save back a certain number of these (I got to 87 with another text extension included). It doesn’t stop you from entering more extensions, only that it saves out a limited set.





  • bulk rename your files to the same extension

    file.1
    file.2
    file.3

    become

    file.1.txt
    file.2.txt
    file.3.txt

    or whatever extension you need

    in windows, open cmd window, navigate to your folder

    then use

    rename *.* *.*.txt

    or do a copy command

    copy *.* *.*.txt

    harder to rename back to original filenames, though


Log in to reply