Community
    • Login

    Limit display to lines with content to the left of "x".

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 4 Posters 1.6k 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.
    • fred339F
      fred339
      last edited by

      I’m trying to understand the structure of a router configuration file that is well-indented.
      So, if I can suppress the display of all of the lines that appear low in the hierarchy, it should help in understanding the structure.
      This means suppressing the lines with blank characters to the left of a set value.
      How can we do this?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @fred339
        last edited by

        @fred339 ,

        My suggestion would be to open the file, then use Language > P > Python to convince Notepad++ that your file is Python, even though it’s not. The Python parser has a feature built in that allows you collapse (hide) different levels.

        Thus, in this side-by-side view of the same file – the left, as normal text; the right, as Python – you can see little boxes with + or - that allow you to manually collapse or uncollapse a section.

        8f7cb1be-d502-4b2e-a0af-9f944a66476f-image.png

        And with manual collapsing:
        da9c6add-c4c1-4ca2-9891-175f53f63d3a-image.png

        In the View menu, there are also options like View > Collapse Level > 3, which would still show the first three levels (0, 4, 8), but hide the 12 underneath, for all the blocks.

        e732652c-dd32-421f-9900-ad58593355f8-image.png

        I think treating it like that would work well for what you’ve described. The nice thing about the Python parser for this is that Python treats the indentation as significant for defining levels, but the Python langauge (and thus the parser) isn’t picky about the number of spaces for a given level; so if you wanted 1 space for the first level, then 7 spaces for the second, then 3 spaces each for additional levels – as long as the spaces are consistent per level, the Python-lexer’s level parsing should work for you.
        b131cd13-59c7-4de9-9cad-8279bbfbfd5a-image.png

        (There might be other parsers that use the indenting-level for code folding, too. But I don’t know what other languages use that, so I’ll just give Python as a known possibility.)

        fred339F 1 Reply Last reply Reply Quote 4
        • caryptC
          carypt
          last edited by

          unproofed : npptextviz-plugin

          Alan KilbornA 1 Reply Last reply Reply Quote -1
          • Alan KilbornA
            Alan Kilborn @carypt
            last edited by

            @carypt

            What do that have to do with the original question asked?
            We are all for anyone answering questions here, but you have to know something about what is being asked and what you are talking about in your response.
            Please refrain from answering if you know nothing, as future readers with the same problem as the OP will just have to sort through it to get the answer they need.

            1 Reply Last reply Reply Quote 1
            • Alan KilbornA
              Alan Kilborn
              last edited by

              Actually, maybe I was a little harsh on @carypt above.

              His 3-word answer hints at a “text visualization” plugin might work as a solution to OP’s issue.
              But the fact that it is “unproofed” is troublesome.

              So I’ll revise my previous post to say “Please don’t post solutions that you haven’t tried, and don’t have a strong sense that they will work”.
              Others, including myself, do that on occasion, but typically with a great deal of confidence from prior experience that a suggested thing will work.

              1 Reply Last reply Reply Quote 2
              • fred339F
                fred339 @PeterJones
                last edited by

                @PeterJones Thank you! That works nicely. It appears that a “level” is defined by the appearance of a curly bracket - which is fine.

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