Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 4 Posters 3.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • swinsterS
      swinster
      last edited by

      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

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @swinster
        last edited by

        @swinster

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

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • swinsterS
          swinster
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • chcgC
            chcg
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • swinsterS
              swinster
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • swinsterS
                swinster
                last edited by

                To cross reference - https://github.com/notepad-plus-plus/notepad-plus-plus/issues/2727

                1 Reply Last reply Reply Quote 0
                • Js jSJ
                  Js jS
                  last edited by

                  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

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors