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

  • 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?

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


    And with manual collapsing:

    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.


    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.

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

  • unproofed : npptextviz-plugin

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

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

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

Log in to reply