Relief for visual impairment ???

hagrid
2013-09-18
2013-11-10
  • hagrid
    hagrid
    2013-09-18

    Hello Folks.
    I am enjoying Notepad++ very much and thank the author for making and sharing it.

    Sometimes I get files that have ASCII art in them (like NFO & DIZ files in shareware).
    The clever authors make them 'pretty' by adding ASCII art.

    This creates a problem for me as I have trouble seeing.

    I wonder if there is a script or tool for Notepad++ to clean up all the extra, useless, visually difficult characters ??

    One example of such a mess:

    ÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ
    ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜ
    ÜÛÛÛ°±±±±±±±±±±±±±±±±±±±ÛÛÛ ÜÛÛÛÛÛÛÛÛÛÛÛÛÜ
    ÜÛÛ²²²±²²²²²²²²²²²²²²²²²²²²²ÛÛ± ÛÛÛ²°° °ÛÛÛÛÛÜ
    ÜÛÛÛÛÛÛÛÛÛÛ°±ÛÛÛÛÛÛÛ²²±±±±±±±±±±±±±±±±±°°±±²ÛÛÛÛ² ²ÛÛÜ
    ÜÛÛÛ °ÛÛÛ±±±²±±±²ÛÛÛÛÛ±²²²²²²²²²²²ÛÛÛ²±±±±ÛÛ ÛÛÛÛÛÛÛÛÛ² ±ÛÛ
    ÛÛ °²ÛÛÛ° °Û²±²²±²ÛÛÛÛÛ²±±±±±±±±±±±±²ÛÛÛÛÛ²±±Û ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ² ÛÛ
    Û² ±ÛÛÛÛÛÛÛÛÛ± Û²±±²ÛÛÛ±°°±±²²ÛÛÛÛÛÛÛ²²²±²±ÛÛÛ²Û ÛÛÛÛ° ±Û²±ÛÛ ° ²Û
    Û° ÛÛÛÛ² ±ÛÛÛÛ° Û²ÛÛÛ²±²ÛÛ²²²²²²±±±²²±±±±±±²²ÛÛ°²ÛÛ± °ÛÛÛÛ± Û±±ÛÛ ±° Û
    Û± °ÛÛÛÛ ÛÛÛ °Û²Û ÛÛÛÛ²²²ÛÛÛÛÛÛÛ±±²²±±ÛÛÛÛÛÛÛÛÛÛÛ²²Û ÛÛÛÛÛÛÛÛÛÛÛÛ±ÛÛ °° Û
    Û ° Û°Û ÛÛÛÛÛÛÛÛÛ°Û ° ÛÛ°²ÛÛÛÛ² ²ÛÛÛ²±ÛÛÛÛ² ²ÛÛÛ²ÛÛÛÛ± °ÛÛ°±±ÛÛ ÜÛ
    Û ± Û±Û Û²Û ²ÛÛÛÛ ° ±ÛÛÛÛ² ²ÛÛ²Û² ²Û²²±²Û ÛÛÛÛ± ÛÛÛÛÛÛ
    Û ± ÛÛ Û°Û °±° °² °° ÛÛ² Û²² ÛÛÛÜ ÛÛÛÛÛÛÛ°°° ²Û²²ÛÛß
    Û °± ÛÛÛ°²Û °±±±° Û² ÜÛÛÛ ²Û²Û² ßÛÛÛ Û ±Û²Û² ²ÛÛ²²ÛÛÛ
    ÛÛ °° °²ÛÛÛ°° ²ÛÛÛ ±Û² ÛÛÛß ²ÛÛÛÛÛÛÛÛ² Û° °ÛÛÛÛÛ±²ÛÛÛß
    Û± °²Û² ±ÛÛÛÛÛ²Û² ²ÛÛ² ÛÛÛÛ °²²ÛÛÛÛÛ ²ÛÛ ±ÛÛÛ±²ÛÛÛÛß
    ÛÛÛÛÛÛÛÛÛÛÛÛÛ²²ÛÛÛ± °° ÛÛÛ° ÛÛ± ÛÛÛÛÛÛÛÛ²ÛÛÛÛÛ²°±²±±²² ßÛÛÛÛÛß
    ßÛÛÛ²±±±±²ÛÛÛÛ° Û °±±±° ±ÛÛÛÛ ÛÛÛÛ²²²²²²²²²²²Û²ÛÛÛÛÛÛÛÛ± ÛÛß

    Very nasty for my old eyes.

    Thanks for any help with this !!!

     
  • Perhaps stripping all characters which aren't alphanumeric (by which I mean all digits plus the letters in the English alphabet) or whitespace would work? This can be done to an entire file with a script.

    Follow these instructions on how to install PythonScript and creating a new script:

    https://sourceforge.net/p/notepad-plus/discussion/331753/thread/6aafb8ae/#7fdd

    But in step 4, paste this:

    def ExtractAlphanumeric(InputString):
        from string import ascii_letters, digits, whitespace
        return "".join([ch for ch in InputString if ch in (ascii_letters + digits + whitespace)])
    
    text = editor.getText()
    notepad.new()
    print ExtractAlphanumeric(text)
    
     
    Last edit: Andreas Jonsson 2013-09-18
  • hagrid
    hagrid
    2013-09-19

    Thanks !!!
    Very seldom in my years of using PCs have I seen any program as amazingly perfect as Notepad++.

    That method is amazing and now I shall associate such files with NPP so I can clean them up instantly before they hurt to look at.

    Only one small thing I would change if I could;
    When it cleans the file it makes another file - whereas it would be better for me if it just cleaned (and even auto-saved) the one I have open.

    Is such a change possible in that script, please ??

    Thanks Very Much for helping me.

     
    Last edit: hagrid 2013-09-19
  • def ExtractAlphanumeric(InputString):
        from string import ascii_letters, digits, whitespace
        return "".join([ch for ch in InputString if ch in (ascii_letters + digits + whitespace)])
    
    text = editor.getText()
    editor.clearAll()
    print ExtractAlphanumeric(text)
    
     
  • Jan Schreiber
    Jan Schreiber
    2013-10-09

    Notepad++ is indeed a very powerful tool.
    For this particular purpose, however, a specialized viewer such as ViewNFO might be better suited.

     
  • cchris
    cchris
    2013-11-10

    How about setting the encoding to OEM 437? You get the original file and the art.

    CChris