• Login
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.
  • F
    fred339
    last edited by Dec 19, 2020, 8:45 PM

    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?

    P 1 Reply Last reply Dec 19, 2020, 9:09 PM Reply Quote 0
    • P
      PeterJones @fred339
      last edited by Dec 19, 2020, 9:09 PM

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

      F 1 Reply Last reply Dec 20, 2020, 7:29 PM Reply Quote 4
      • C
        carypt
        last edited by Dec 20, 2020, 2:31 AM

        unproofed : npptextviz-plugin

        A 1 Reply Last reply Dec 20, 2020, 4:04 AM Reply Quote -1
        • A
          Alan Kilborn @carypt
          last edited by Dec 20, 2020, 4:04 AM

          @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
          • A
            Alan Kilborn
            last edited by Dec 20, 2020, 1:09 PM

            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
            • F
              fred339 @PeterJones
              last edited by Dec 20, 2020, 7:29 PM

              @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
              4 out of 6
              • First post
                4/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors