• Remove selected bookmarks without removing lines

    3
    0 Votes
    3 Posts
    1k Views
    Terry RT

    @Terry-R said in Remove selected bookmarks without removing lines:

    There’s a slight anomaly which I seem to be noticing.

    Perhaps not quite the right statement as it implies a possible issue.

    I’d say this is by design due to inclusion of the EOLs which determine if the bookmark is erased in the original file.

    So if you normally highlight ONLY to the end of the line this will miss the last EOL.

    Terry

  • Filter using columns?

    8
    0 Votes
    8 Posts
    3k Views
    guy038G

    Hello, @znc-gatilho, @alan-kilborn, @peterjones, @mark-olson, @coises and All,

    @znc-gatilho, could you confirm me that your three important zones are, by priority order :

    Zone 'SRtng' : Between columns 114 and 118 ( 5 chars ) Zone 'Tit' : Between columns 77 and 79 ( 3 chars ) Zone 'WTit' : Between columns 82 and 85 ( 4 chars )

    If so, let’s start with this INPUT text, containing the headers line 1 and 3 random records ( lines 626897, 626912 and 626917 )

    ID Number Name Fed Sex Tit WTit OTit FOA SRtng SGm SK RRtng RGm Rk BRtng BGM BK B-day Flag 4109228 Kryukova, Irina RUS F WGN WNM 2232 0 20 2240 0 20 1968 wi 36016672 Kryvinski, Jenny FRA F 2001 w 14102897 Kryvolapov, Kostiantyn UJR M IM 2356 1 10 2327 0 20 1962

    Open these four lines text in a new tab

    Move to the very beginning of your file ( Ctrl + Home )

    Open the Replace dialog ( Ctrl + H )

    Un-tick all box options

    Type in (?-s)^.{76}(...)..(....).{28}(.....).+ in the Find what : zone

    Type in \3 \1 \2 $0 in the Replace with : zone

    Select the Regular expression search mode

    Click on the Replace All button

    => At once, you should get this temporary text :

    SRtng Tit WTit ID Number Name Fed Sex Tit WTit OTit FOA SRtng SGm SK RRtng RGm Rk BRtng BGM BK B-day Flag 2232 WGN WNM 4109228 Kryukova, Irina RUS F WGN WNM 2232 0 20 2240 0 20 1968 wi 36016672 Kryvinski, Jenny FRA F 2001 w 2356 IM 14102897 Kryvolapov, Kostiantyn UJR M IM 2356 1 10 2327 0 20 1962

    Now, select the three lines, after the headers line

    Run the Edit > Line Operations > Sort Lines Lexicographically Ascending option

    => You should get your expected OUTPUT text :

    SRtng Tit WTit ID Number Name Fed Sex Tit WTit OTit FOA SRtng SGm SK RRtng RGm Rk BRtng BGM BK B-day Flag 36016672 Kryvinski, Jenny FRA F 2001 w 2232 WGN WNM 4109228 Kryukova, Irina RUS F WGN WNM 2232 0 20 2240 0 20 1968 wi 2356 IM 14102897 Kryvolapov, Kostiantyn UJR M IM 2356 1 10 2327 0 20 1962

    As you can see your file is, automatically sorted by the three zones SRtng then by Tit then by WTit ascending

    BTW, @Peterjones, I suppose that the SRtng zone is the ELO rating of chess players, which is ALWAYS a 4 number string for experienced players and grand masters ! . So, no trouble for the sort

    Now, just repeat the steps above, with your players_list_FOA.txt file

    Of course, do a backup of your players_list_FOA.txt, before any action

    Beware that your file is really an huge file ( 216,785,860 bytes for 1,321,866 lines !! )

    Thus, I cannot tell you how longer the search/replacement and the save operations will take till completion, when applied to THIS file !

    However, you can give it a try !

    Of course, in case that the zones do not belong to the mentioned ranges, just tell me the exact values in order to modify the search regex, accordingly :-)

    Best Regards,

    guy038

  • 'Unwrapping' something

    3
    0 Votes
    3 Posts
    386 Views
    Mark OlsonM

    JsonTools is my plugin, and it does have pretty-printing of JSON, which would do what you want.

    That said, JsonTools can’t currently edit files in the hard drive. For example, there’s no tool implemented at present that allows you to choose a bunch of JSON files and pretty-print them all in one go.

    Would you like me to start working on that?

  • Help for a very specific scenario

    10
    0 Votes
    10 Posts
    831 Views
    ImgemaI

    @Paul-Wormer

    When i said the filenames are random i meant they aren’t necessarily named as “filename”. That was just my example so i picked that as a generic name. The only thing that matters is that the subfolder has the exact same name as the bin file inside.

    For instance this:

    <path>./Filename 1/Filename 1.bin</path>

    Could be this:

    <path>./Have A Nice Day/Have A Nice Day.bin</path>

    It’s a path that leads to a .bin file and there’s a subfolder before that which i want to delete. But because in the .xml file there are thousands of such files and subfolders that follow the same rule, i needed to do it in bulk. I thought it was obvious from the example in the OP so apologies for any confusion and wasted time.

    Anyway, this worked:

    FIND - \\(.*?)\\(\1) REPLACE WITH - \\$1 SEARCH MODE - Regular Expression

    Though at first it didn’t because all the \ were reversed / in the xml.

  • I would like to group all similar domains, not by alphabet.

    37
    0 Votes
    37 Posts
    4k Views
    guy038G

    Hi, @mohammad-al-thobiti and All,

    Again, I’m going to simplify the problem, using a Python script, called Replacements_Lists.py, listed below :

    ''' Refer to : https://community.notepad-plus-plus.org/topic/19889/ - Given TWO files : - A MAIN one, located in the MAIN view, containing a LIST of strings or lines - A SECOND one, located in the SECONDARY view, containing : - A LIST of strings to REPLACE, EACH followed with a TABULATION and its CORRESPONDING replacement string This script replaces EACH expression of the MAIN file by the CORRESPONDING replacement string, found in the SECONDARY file NOTES : - The REPLACEMENT strings may be ABSENT IF you do NOT write anything AFTER the TABULATION separator. Thus, these SPECIFIC searched strings will be DELETED - The strings of the MAIN file, NOT found in the SECONDARY file, are simply REWRITTEN - The LEADING strings of the SECONDARY file, NOT found in the MAIN file, are simply NOT used - The list of the DIFFeRENT ranges < SEARCHED string > \t < REPLACEMENT string > must END with a FINAL line-break or NOTHING else ( \z ) ''' from Npp import editor1, editor2 replacements = dict(line.split('\t') for line in editor2.getText().splitlines() if line) def replace_with(m): try: r = replacements[m.group()] except KeyError: r = m.group() return r editor1.rereplace('(?-s).+', replace_with)

    So, just follow this road map :

    Open your entire file containing all your records ( about 181,170 ) in the main view

    Open your file containing the 1.027 lines, whose all the occurrences must be deleted in the main file

    Move this file in the secondary view ( IMPORTANT )

    I suppose that these two files ONLY contains main domain names, one per line

    Run the Edit > Blank operations > Trim Leading and Trailing Space option for the two files

    Now, in the secondary view, use this regex S/R :

    SEARCH (?<=.)$

    REPLACE \t

    in order to produce a correct replacement list for some domain’s names by nothing

    Move back to your file in the main view

    Run the Plugins > Python Script > Scripts > Replacements_List.py option

    => Immediately, all the lines, of the main view, which match one of the lines of the secondary view, have been replaced with an empty line

    Run the Edit > Line Operations > Remove Empty Lines

    Finally save your uptaded file, in the main view

    Voilà !

    Best Regards,

    guy038

    P.S. :

    If you need to install the Python Script plugin, follow this FAQ

  • Settings, custom styles and shortcuts got reset after power loss

    4
    0 Votes
    4 Posts
    410 Views
    PeterJonesP

    @siswonugroho said in Settings, custom styles and shortcuts got reset after power loss:

    One question, what file should I copy to backup my custom style? Files inside the themes folder, stylers.xml or both?

    That depends completely on your definition of “my custom style”.

    Do you mean “I am using the default light mode theme, but with manual edits”? Then you need to backup stylers.xml Do you mean “I am using the DefaultDarkMode theme, which is what it naturally picks when I chose dark mode”? Then if you use it without editing, just pick Dark Mode again, and it will go back to the right theme; if you do edit the DefaultDarkMode theme, then you will have to backup that theme’s file from the themes\ folder. Do you mean “I picked the ‘Bespin’ theme (or one of the other built-in themes) and haven’t made any changes to it”? Then all you have to do is re-pick the ‘Bespin’ theme (or whichever it was) if N++ ever reverts to default again. Do you mean “I picked the ‘Bespin’ theme (for example) and then made changes to the stylings defined by that theme”? Then you will have to save a backup of your modified ‘Bespin’ theme from the themes\ directory. Do you mean “I downloaded some other theme that doesn’t ship with Notepad++ and put it in my themes\ directory, and am using that theme”? Then you will want to backup that theme.
  • Can't set notepad++ as default program in Windows 10???

    14
    0 Votes
    14 Posts
    31k Views
    E

    This did work for me, I had instances of the x86 version in the registry that after manually changing in regedit, and also setting the file associations in Notepad++ settings (preferences), I was able to set the file associations and default programs.

  • Auto-complete does not work fully as I would expect.

    3
    0 Votes
    3 Posts
    230 Views
    Piotr KostrzewskiP

    Thank you.
    I had it turned on but on TAB and I clicked Enter. Have a nice weekend.

  • Red category??

    5
    0 Votes
    5 Posts
    298 Views
    Paul WormerP

    @Khyr-Isles-S-Jusch Please accept my apology. As appears from the other answers, I completely misunderstood your question. My answer is neither here nor there.

  • \autoCompletion files: incorrect handling of utf8 encoding

    2
    0 Votes
    2 Posts
    173 Views
    PeterJonesP

    @Nikita-V ,

    Because of the way Notepad++ was coded, you currently have to use &-entities in autoCompletion\_____.xml in order to get non-ASCII to show in the auto-completion popups

    <Environment ignoreCase="no" startFunc="(" stopFunc=")" paramSeparator="," terminal=";" /> <KeyWord name="a&#x0410;&#x0411;&#x0412;&#x0413;" /> <KeyWord name="e&#x0414;&#x0415;&#x0416;&#x0417;" /> <KeyWord name="abs" func="yes"><Overload retVal="" descr="absolute value function: &#x041C;&#x041D;&#x041E;&#x041F;"><Param name="VALUE" /></Overload><Overload retVal="" descr="absolute value function"><Param name="" /></Overload></KeyWord>

    6bfc2aac-8825-4619-bd7f-26f5d2134ea8-image.png
    4975881d-3913-40f4-b331-cb59a3f4990c-image.png

  • weird icons

    2
    0 Votes
    2 Posts
    172 Views
    Alan KilbornA

    @zeta-orionis

    Try:

    7c425fa4-886c-405c-b339-c57995467f3a-image.png

  • CSS Highlighting Stopped Working

    4
    0 Votes
    4 Posts
    376 Views
    Patrick SkeltonP

    (Unfortunately, I am not allowed to link to usernames, as I have not used the forum before.)

    My apologies - it was not my intention to waste anyone’s time. My question was so general (I had no idea when it started or any steps I might have taken beforehand) that I wasn’t sure what to supply. I accept a screenshot might have been helpful.

    The comment by mkupper about a portable install got me thinking that a normal reinstall probably wasn’t a bad idea and it has fixed it.

    Thank you for the comments.

    Kind wishes - Patrick

  • c# lang. with function plugin

    2
    0 Votes
    2 Posts
    273 Views
    PeterJonesP

    @Philippe-GRANGE ,

    It’s not a plugin: the Function List tool is a built in portion of Notepad++.

    And it can and does find functions in C#. I don’t have any C# handy, so I made some C#-like code just to test, and it works for me:

    765952d6-51ed-47df-9d3f-0a2b6b811df3-image.png

    Using my knowledge of C/C++ to interpret C# syntax, the screenshot you showed doesn’t have any functions shown – I see class variables and an enum, but no function/method (though that’s not to say that maybe there isn’t one lower down in your source code).

    However, you should know that the Function List will only show a given class if it contains at least one function/method. Also, if you’ve changed your code, you might need to hit the refresh button to get the FunctionList feature to re-parse your file.

    If you have a small C# file (a dozen or two lines) that you can paste which you think should show an actual function, but does not for you, and you want us to try to replicate the problem, you need to share that code by pasting the code in your reply, highlight it, and click the </> button to mark it as “code”. For example, the code I showed in my screenshot is pasted here:

    using System; namespace TestTracker { public class UserRect { void dummyFunction(void) { return; } } }
  • installing NPP offline user manual

    2
    0 Votes
    2 Posts
    340 Views
    PeterJonesP

    @zeta-orionis ,

    You click the download link from the user manual homepage, then unzip it into whatever directory you want, and you open index.html from that directory to look at the manual. After you have it on your PC, you are no longer restricted to seeing the user manual just when you have an internet connection.

  • Notepad++ v8.5.7 Installer Hangs on regsvr32 command

    5
    2 Votes
    5 Posts
    2k Views
    xomxX

    @John-Wittle said in Notepad++ v8.5.7 Installer Hangs on regsvr32 command:

    It got up to this following point, and then got stuck

    Probably not a N++ fault.

    You can try (for most of the following you will need admin-rights or it probably silently fails):

    click on the Windows Start (or press the Win-key on your keyboard) type “cmd” right click on the offered Command Prompt app, select Run as administrator in the opened cmd-window - unregister previous attempt before another registering attempt (e.g.: regsvr32 /u “C:\Program Files\Notepad++\contextMenu\NppShell.dll” ) Logoff/logon (a complete reloading of the Windows Explorer for surety…) Then re-register ( regsvr32 “C:\Program Files\Notepad++\contextMenu\NppShell.dll” )

    If still not resolved, try to use the NppShell inherent logging:
    https://github.com/notepad-plus-plus/nppShell/pull/41
    and repeat the above steps.

    Then collect and post here the created %APPDATA%\NppShell\NppShell.log (i.e. C:\Users\[loginname]\AppData\Roaming\NppShell\NppShell.log)

    And do not use the regsvr32 /i ... for the new NppShell (there is not such exported “DllInstall” function in it).

  • Style words depending the end character

    4
    0 Votes
    4 Posts
    325 Views
    PeterJonesP

    @Txote-Lusco ,

    Sorry, the EnhancedAnyLexer plugin doesn’t work that way. It cannot take the matching word from a pattern on one line, and highlight that same text even in different circumstances later.

    You seem to want more features than UDL alone, or UDL-plus-EnhanceAnyLexer, can give you. At that point, the remaining option is to write a custom lexer for your language: but that’s a complicated task, and we’re not going to do that for you; you will either have to write your own lexer, or hire someone to do it for you. (And no, there’s no “request for hire” section in this forum; if someone is interested, they could private-message you using the chat feature in the forum, but this isn’t a “jobs board”.)

    [Also, you originally posted your second message as a separate Topic, but since it was about syntax highlighting in the same UDL, I merged it together, so that people can get the full conversation without having to click links to other discussions.]

  • Notepad ++ Installation and Explorer.exe crash only in Safe Mode

    11
    2 Votes
    11 Posts
    1k Views
    I

    @mkupper Exactly! Thank you for helping to correct this very annoying problem. Have a nice day!

  • All Tabs Removed

    6
    0 Votes
    6 Posts
    2k Views
    mkupperM

    Thank you @Kendall-DeMott

    Are you using roaming desktops or something like Citrix where you can sign in on any workstation and your stuff is usually there?

    Something else is that if a file/tab is not available is not available when you start Notepad++then Notepad will silently close the tab rather than showing file not found errors. If you have files on a file server and the network or server is down at the time you start Notepad++ then Notepad++silently removes the tabs.

    The tabs are in the %AppData%\Notepad++\Session.xml file.

    Open up a few files and then close/exit Notepad++. See if the %AppData%\Notepad++\Session.xml file shows that it has been recently modified.

    Notepad++ only saves the Session.xml file when you exit or close Notepad++.

    Now, restart Notepad++. Are your tabs still there?

    A normal logoff from a Windows desktop session will send exits/quits to all applications. If you do a logoff when Notepad++ is running then it will add a few lines to the %AppData%\Notepad++\nppLogNulContentCorruptionIssue.log file. If you look at that file you should see lines with WM_QUERYENDSESSION, WM_ENDSESSION, etc. where Notepad++ is logging the signals from Windows that the desktop session is about to end. The list of lines ends with one for WM_DESTROY.

    The tab stuff and Session.xml file have not changed in many years and so it’s doubtful an update to Notepad++ would trigger the issues you are seeing.

  • View Current File in portable versions of browsers

    5
    0 Votes
    5 Posts
    420 Views
    deleeleeD

    @Alan-Kilborn said in View Current File in portable versions of browsers:

    If Windows can’t or won’t do that, there’s nothing Notepad++ can do about it.

    Thanks Alan. Obviously Windows is being difficult. However, it’s good to know it’s nothing to do with Npp.

  • Creating a macro that uses search hangs NPP

    2
    0 Votes
    2 Posts
    178 Views
    mkupperM

    @Jason-Quattrini I’m not sure how to do it as a macro but, if you are using regular expression mode your search pattern can be.*pattern.*\R.*\R.*

    The first .* is all of the line before your pattern of whatever it is you are searching for. This bypasses the need for you to press the Home key.

    The .*\R after your pattern goes from the end of the pattern that matched to the end of that line plus \R for the invisible end-of-line character(s) that are at the end of each line.

    The second .*\R picks up all of the second line including the end of line character(s). The third part with .* but no \R picks up all of the third line but not the end-of-line character(s) themselves.

    You can then do search-replace using Replace All and it’ll do what you want without needing to use a macro.