Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Login
    1. Home
    2. Popular
    Log in to post
    • All Time
    • Day
    • Week
    • Month
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All categories
    • Maverick F-16CM

      Selecting (phisically, not bookmarking) all the lines contianing a specific parameter or a specific word

      Notepad++ & Plugin Development
      • • • Maverick F-16C
      19
      0
      Votes
      19
      Posts
      160
      Views

      guy038G

      Hello, @maverick-f-16c, @peterjones, @coises, @terry-r, @mark-olson and All,

      Ah… OK. If your two files have approximately 300K lines, my previous regex S/R won’t probably find nothing as it’s over the usual capacities of the Boost regex engine of Notepad++ !

      So, I would choose the @coises’s way, using the N++ sort to get the right results. I did not fully read the @coises’s method and I prefer start from scratch !

      So, let’s suppose we start with two files :

      File_1.txt : FFF = 79 K = 6 C = 4 A = 8 XXX = 7 H = 51 BB = 6 E = 0 GA = 339 J = 4 DZ = 9 II = 6 File_2.txt : E = 5 J = 0 FFF = 4 ZYX = 1 A = 0 II = 18 DZ = 2 K = 6 C = 17 H = 27

      Note that the records, in these two files, are randomly sorted, on purpose !

      As in my previous post, create a new File_3.txt with the contents of File_1.txt, a separation line of some @ chars then the contents of File_2.txt : FFF = 79 K = 6 C = 4 A = 8 XXX = 7 H = 51 BB = 6 E = 0 GA = 339 J = 4 DZ = 9 II = 6 @@@@@@@@@@@@@@@ E = 5 J = 0 FFF = 4 ZYX = 1 A = 0 II = 18 DZ = 2 K = 6 C = 17 H = 27

      Now, execute , successively, the two regex S/R, below :

      • SEARCH \x3D • REPLACE ( )\x3D

      Then :

      SEARCH (?-s)^.{40}\K\x20+

      REPLACE Leave it EMPTY

      Click only on the Replace All button

      You should get this OUTPUT :

      FFF = 79 K = 6 C = 4 A = 8 XXX = 7 H = 51 BB = 6 E = 0 GA = 339 J = 4 DZ = 9 II = 6 @@@@@@@@@@@@@@@ E = 5 J = 0 FFF = 4 ZYX = 1 A = 0 II = 18 DZ = 2 K = 6 C = 17 H = 27

      Then, move the caret on the first line, at column 25

      Select a 12×0 rectangular selection of all the records BEFORE the @@@@@@@@@@@@@@@ line

      Type in the A letter

      Select the column editor ( Alt + C )

      Select Number to Insert with all zones = 1, fill in with the 0 char and click on the OK button

      Then move to the first line, at column 25, AFTER the @@@@@@@@@@@@@@@ line

      Again do a 10×0 **rectangular selection of all the records AFTER the @@@@@@@@@@@@@@@ line

      Type in the B letter

      Select the column editor ( Alt + C )

      Select Number to Insert with all zones = 1, fill in with the 0 char and click on the OK button

      You should get this OUTPUT :

      FFF A01 = 79 K A02 = 6 C A03 = 4 A A04 = 8 XXX A05 = 7 H A06 = 51 BB A07 = 6 E A08 = 0 GA A09 = 339 J A10 = 4 DZ A11 = 9 II A12 = 6 @@@@@@@@@@@@@@@ E B01 = 5 J B02 = 0 FFF B03 = 4 ZYX B04 = 1 A B05 = 0 II B06 = 18 DZ B07 = 2 K B08 = 6 C B09 = 17 H B10 = 27 Now, perform a classical sort, using the Edit > Line Operations > Sort Lines Lexicographically Ascending option

      We get :

      @@@@@@@@@@@@@@@ A A04 = 8 A B05 = 0 BB A07 = 6 C A03 = 4 C B09 = 17 DZ A11 = 9 DZ B07 = 2 E A08 = 0 E B01 = 5 FFF A01 = 79 FFF B03 = 4 GA A09 = 339 H A06 = 51 H B10 = 27 II A12 = 6 II B06 = 18 J A10 = 4 J B02 = 0 K A02 = 6 K B08 = 6 XXX A05 = 7 ZYX B04 = 1 Delete the @@@@@@@@@@@@@@@ line

      Then, run the following regex S/R :

      SEARCH (?-s)^((\w+)\x20+A.+?)\d+(?=\R\2\x20+B.+=\x20+(\d+))

      REPLACE \1\3

      The OUTPUT is now changed as :

      A A04 = 0 A B05 = 0 BB A07 = 6 C A03 = 17 C B09 = 17 DZ A11 = 2 DZ B07 = 2 E A08 = 5 E B01 = 5 FFF A01 = 4 FFF B03 = 4 GA A09 = 339 H A06 = 27 H B10 = 27 II A12 = 18 II B06 = 18 J A10 = 0 J B02 = 0 K A02 = 6 K B08 = 6 XXX A05 = 7 ZYX B04 = 1

      Note : As you can see, due to the previous sort, the search regex just need to find, each time, two consecutive lines of the form :

      ABCD A#1 = xxx ABCD B#2 = yyy

      Which begin with the same value ABCD and replace the xxx value by the yyy value. This explains why this solution should work with huge files, without any problem !

      Now, move again the cursor on the first line, at column 25

      Perform a 22×0 ( or 22×3 ) rectangular selection of all the records

      Once more, use the Edit > Line Operations > Sort Lines Lexicographically Ascending option

      We get :

      FFF A01 = 4 K A02 = 6 C A03 = 17 A A04 = 0 XXX A05 = 7 H A06 = 27 BB A07 = 6 E A08 = 5 GA A09 = 339 J A10 = 0 DZ A11 = 2 II A12 = 18 E B01 = 5 J B02 = 0 FFF B03 = 4 ZYX B04 = 1 A B05 = 0 II B06 = 18 DZ B07 = 2 K B08 = 6 C B09 = 17 H B10 = 27

      Finally, use this regex S/R, to get, in File_3.txt, the updated values of File_1.txt ( from File_2.txt )

      SEARCH (?-is)\x20+(A)\d+\x20+|^.+\x20B(?s).+

      REPLACE ?1\x20

      FFF = 4 K = 6 C = 17 A = 0 XXX = 7 H = 27 BB = 6 E = 5 GA = 339 J = 0 DZ = 2 II = 18

      Notes :

      As you can verify, the order of the lines, in File_3.txt, is identical to the initial order of these lines in File_1.txt

      The records, present in File_1.txt and not in File_2.txt, are not changed

      The records, present in File_2.txt and not in File_1.txt, are not added, either

      Again, this solution should work in all cases, even with files with million of lines !

      Best Regards,

      guy038

    • M

      Searching random duplicate numbers/values in Notepad++

      Help wanted · · · – – – · · ·
      • • • MariusGHub
      15
      0
      Votes
      15
      Posts
      131
      Views

      Alan KilbornA

      @Mark-Olson said in Searching random duplicate numbers/values in Notepad++:

      I don’t particularly appreciate people (cf. AlanKilborn) nitpicking my solution, which was perfectly adequate for this problem.

      Too bad? We try to keep things “on track” here. If something devolves into “I’ll write what is effectively not a Notepad++ solution” here, it shouldn’t be here.

    • ahmoy lawA

      Unable to run notepad++ with debug mode (for testing plugin)

      Notepad++ & Plugin Development
      • • • ahmoy law
      9
      0
      Votes
      9
      Posts
      93
      Views

      ahmoy lawA

      Hi Plugin Community,

      I have managed to test my plugin using notepad++ old version 7.8.9.

      Thanks,
      Ahmoy Law

    • Mohamed MohamedM

      How to use plugin in notepadd++

      Notepad++ & Plugin Development
      • • • Mohamed Mohamed
      7
      0
      Votes
      7
      Posts
      122
      Views

      Mohamed MohamedM

      @PeterJones Ok thanks.

    • Borderless MediaB

      Removing Text Before and After dialogue.

      Help wanted · · · – – – · · ·
      • • • Borderless Media
      5
      0
      Votes
      5
      Posts
      80
      Views

      Borderless MediaB

      I want to Thank you guys for this. Yesterday I tried Peter’s code first and it worked but there were still some things left behind. Inevitably i found a wayto cancel them out so great work either way.

      Terry for some reason My Notepad++ freezes when i used your method to replace all.

      Guy038, yours worked perfectly. It got rid of everything and also spaced out the lines. I intended to put them into a word doc and realized that word automatically spaces out lines so it seems I put you guys through a bit more work than needed but those codes got the job done. I won’t be needing further help on this i believe.

      Thanks again and warm regards

    • Claudio RaphaelC

      How to change word and numerate this document!!

      Help wanted · · · – – – · · ·
      • • • Claudio Raphael
      5
      0
      Votes
      5
      Posts
      93
      Views

      Claudio RaphaelC

      @Coises

      Sir, you are awesome!! Thank u very much.

      Claudio Raphael

    • Sanford ArbogastS

      CSS comments should be in GREEN

      General Discussion
      • • • Sanford Arbogast
      4
      1
      Votes
      4
      Posts
      121
      Views

      R

      @mkupper said in CSS comments should be in GREEN:

      If I am viewing an .htm file that contains a <script>…</script> is the lexer/formatter/highlighter/colorizer code at all related to the lexer/formatter/highlighter/colorizer code that would process the same chunk of JavaScript in a .js file? Or are they 100% unrelated code paths and updated/maintained independently?

      HTML is styled by this lexer module, which defines styles for all generic SGML markup (XML included) as well as (very basic) JavaScript, ASP and JSP scripts, and (Python) Mako templates, but not <style> elements.

      There is also a complete module for independent style sheets with the *.css or *.scss extension.

      It’s well documented that there’s no styling of embedded CSS in HTML documents. You can read through this (partial) list of open bug reports, the oldest dating from 2005:

      “No CSS highlighting inside HTML file” “Embedded CSS highlighting bug” “Multiple Lexers for HTML files” “Scintilla HTML code style recognition” “<style> tag do[es]n’t highlighting in php file in <html> tag”

      There really is no simple way to programmatically switch between completely different lexer modules in the same editing window. Scintilla is basically a synchronous, single-threaded service running inside the application (despite the addition last year of optional parallelization for line layout).

      What VS Code and other Textmate-based editors are doing is basically regex matching. The EnhanceAnyLexer plugin for N++ can provide something like that by setting custom styles for portions of the document that match a user-defined regex.

    • Mike NYCM

      Change Value in specific column...

      General Discussion
      • • • Mike NYC
      4
      0
      Votes
      4
      Posts
      70
      Views

      CoisesC

      @Mike-NYC said in Change Value in specific column...:

      I have a lot of csv files

      I missed that part.

      At present, Columns++ only works on one open file at a time. So it probably won’t help you.

      The method @PeterJones described in the Update section of his post is, at the moment, the only method of which I’m aware that could be applied to many files at once (using Search | Find in Files…).

    • linzhongziL

      Displaying error in codes

      General Discussion
      • • • linzhongzi
      3
      0
      Votes
      3
      Posts
      27
      Views

      R

      P.S.

      Make sure to paste the following into your issue comment:

      `Accessor::ColourTo` is called on the high order byte of `】` as if it were a local variable: https://github.com/ScintillaOrg/lexilla/blob/4c5e7a0ef5410ed26bf99203cf27227413865f4d/lexers/LexBatch.cxx#L485-L497 The offset calculation should take multi-byte character boundaries into account.
    • donhoD

      0110001001101001011101000010000001110110011100110010000001100010011110010111010001100101

      Humour
      • • • donho
      3
      2
      Votes
      3
      Posts
      48
      Views

      Mark OlsonM

      @mkupper said in 0110001001101001011101000010000001110110011100110010000001100010011110010111010001100101:

      is there a way to do it in one shot within Notepad++.

      Yes, but only if you count running a pure python PythonScript script with no editor/notepad functions

    • gerdb42G

      Is XPatherizerNPP Plugin abandonware?

      Notepad++ & Plugin Development
      • • • gerdb42
      3
      0
      Votes
      3
      Posts
      46
      Views

      Mark OlsonM

      @gerdb42
      I know almost nothing about XPath, so can’t comment on the relative quality of this specific solution, but I do know that XmlTools can evaluate XPath expressions. It hasn’t been modified in about a year, but it still works fine on the most recent version of NPP. XmlTools also has a bunch of other nice goodies.

    • M SocinM

      Assistance Required: Recovery of Corrupted Notepad++ Tabs

      Help wanted · · · – – – · · ·
      • • • M Socin
      3
      0
      Votes
      3
      Posts
      32
      Views

      PeterJonesP

      @M-Socin said in Assistance Required: Recovery of Corrupted Notepad++ Tabs:

      I have had 25 tabs open in Notepad++ since around 2019, which, due to the program’s auto-reopen feature, I never found the need to save.

      You’ve had the same unsaved files for 4+ years?! First, you’ve been lucky to date. Second, I highly recommend changing your data practices – see our FAQ section on the Backup / AutoSave, to figure out how to set things up to be safer so that you’re less likely to lose your data.

      That FAQ also has some suggestions for things you can try to recover lost data – including describing the directories that things might be in, depending on your settings; but Notepad++ doesn’t have built-in file recovery, so if the file is corrupt or lost, there is nothing we or Notepad++ can do for you; the FAQ mentions that you might have success using external recovery tools, but we don’t guarantee that will work nor are we experts at their use.

      .'¨}ö& 3iŮa]ž<Á«PŮ×vo ...

      That looks like a binary file. If it didn’t used to be a binary file, then one of a few things happened:

      A Windows crash corrupted the files. You were infected with a virus, and the virus has corrupted your files.

      Since you didn’t ever actively save or back up your important data, that data is likely lost in either case, but recovery software (as mentioned at in the FAQ) might be able to find some of your files (though it might be an older version). Good luck.

      For the future, I highly recommend following data best-practices, as described in the FAQ, and taking an active role in making sure you don’t lose important data in the future (whether you edit that data in Notepad++ or any other tool; no single tool can guarantee 100% that you won’t lose data due to circumstances outside their control).

    • Jayden GirdJ

      Auto completeion is not working

      Help wanted · · · – – – · · ·
      • • • Jayden Gird
      3
      0
      Votes
      3
      Posts
      33
      Views

      PeterJonesP

      @Jayden-Gird said in Auto completeion is not working:

      It does nothing.

      Do you have other text in your file yet? If not, then the “word completion” half of the auto-completion feature will not do anything, because “word completion” requires other words to be in your file.

      Do you have a Language set in the Language menu (like HTML or C++ or anything else from that menu)? If not, then the “function completion” half of that feature will not do anything, because “function completion” requires an active programming language to be set.

    • Alan KilbornA

      Breakpoints disabled in release mode

      Notepad++ & Plugin Development
      • • • Alan Kilborn
      3
      1
      Votes
      3
      Posts
      59
      Views

      CoisesC

      @Alan-Kilborn said in Breakpoints disabled in release mode:

      I’d run in Debug build mode, but there are some assertions that fire when I have certain data in a Scintilla editing window, and these “get in the way” of what I’m trying to debug.

      If you right-click the Notepad++ project in the Solution Explorer pane and select Properties, under Linker there is a Debugging page. Select the Release configuration and change Generate Debug Info to “Generate Debug Information (/DEBUG)”; that should let you compile as for release, but with symbols. Just remember not to commit the changes to the .sln file.

    • ahmoy lawA

      Settings specific to plugin (maybe folder to the plugin)

      Notepad++ & Plugin Development
      • • • ahmoy law
      3
      0
      Votes
      3
      Posts
      55
      Views

      ahmoy lawA

      @Coises Many thanks!!!

    • RichieR

      Collect duplicates in doc before sign

      Help wanted · · · – – – · · ·
      • • • Richie
      2
      0
      Votes
      2
      Posts
      34
      Views

      Mark OlsonM

      @Richie
      How many lines of data do you have? The optimal solution for this problem can vary a lot depending on how much data you have.

      Also, are all the entries with duplicate values before the # consecutive? For example, are all T-shirt entries grouped together, or are there non-T-Shirt entries between the first T-shirt entry and the last?

      Assuming the entries with duplicate values before # are grouped together, a reasonable solution (even for a large amount of data) would be as follows:

      Go to the find/replace form, Mark tab (Ctrl+M with default hotkeys) With Bookmark line selected and using Regular expression as search mode, enter (?-s)(^[^#\r\n]+)#.*\R(\1#.*$\R?)+ into the Find what box, and hit Mark all. Notes on this regular expression (general resources available here): (?-s) means that the . metacharacter won’t match newlines. (^[^#\r\n]+)# tries to match a sequence of characters that are not # or a line-end character at the start of a line followed by #, and then stores it as capture group 1. .*\R matches any number of non-newline characters, then a newline. (\1#.*$\R?)+ matches at least one line where the thing before # in the first line is followed immediately by # and then any number of characters before the end of the line ($) and then possibly a newline (\R? - the only thing there could be other than a newline here is the end of the file) You will see all the lines with a duplicate entry before # marked. Use Search->Bookmark->Remove Non-Bookmarked lines from the main menu. Now all the entries with no duplicate before the # will remain.

      Note that the Remove Non-Bookmarked lines operation can be rather slow if the number of lines to be removed is large (say, 10 thousand or more). If that’s a problem, you can use Copy Marked Text (the third button under the Mark all and Clear all marks buttons in the Mark form) instead to copy the text that you marked in step 2, then paste it into another buffer (or select the entire original file and paste over it). You’d have to do some simple regex-based postprocessing of the result after that, but I’ll leave that as an exercise for you.

      If the entries with duplicate values are not grouped together, you will need to sort the entries by the value before the #, and then follow the steps above. This sorting is difficult to achieve without a custom script, but fortunately I and fellow forum regular AlanKilborn have already written such a script.

    • Piotr KostrzewskiP

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

      Help wanted · · · – – – · · ·
      • • • Piotr Kostrzewski
      2
      0
      Votes
      2
      Posts
      31
      Views

      Alan KilbornA

      @Piotr-Kostrzewski said in Auto-complete does not work fully as I would expect.:

      but when I click enter, it moves the cursor to a new paragraph without completing the word

      I’ve heard of pressing Enter, but not clicking Enter. Assume you mean pressing…

      Regardless, I think you’ll want to check to see that the checkbox indicated is checked:

      c0f94818-c3a8-4ec8-b464-c37114acd4c2-image.png

      Also, having a look at the user manual HERE would be a good idea for you.

    • John WittleJ

      Notepad++ v8.5.7 Installer Hangs on regsvr32 command

      Help wanted · · · – – – · · ·
      • installer context menu • • John Wittle
      2
      2
      Votes
      2
      Posts
      42
      Views

      PeterJonesP

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

      I ran the command regsvr32 “C:\Program Files\Notepad++\contextMenu\NppShell.dll”, it exited with no error codes, but I still don’t have that context menu option.

      When you ran that, was it as normal user or Admin? Because it might be that registering the DLL requires elevated Admin privileges.

      Also, maybe try the alternative syntax regsvr32 /i "C:\Program Files\Notepad++\contextMenu\NppShell.dll" (as we say in the Manual, “Some users have had more success with one or the other, so if you get an error with one, you may have to try another to get it to work.”)

      (And I’ve upvoted your post, so you should have enough reputation to post your image now.)

    • Txote LuscoT

      Style words depending the end character

      Help wanted · · · – – – · · ·
      • • • Txote Lusco
      2
      0
      Votes
      2
      Posts
      37
      Views

      PeterJonesP

      @Txote-Lusco said in Style words depending the end character:

      But I tried many times this…and never find the solution.

      That’s because the User Defined Language (UDL) definition just has a simple set of rules that it can make use of, and fancy rules that you described are not possible with UDL alone.

      However, using the EnhanceAnyLexer plugin, you can add a regex-based rule in addition to the normal UDL-based highlighting:

      Install EnhanceAnyLexer ((use Plugins > Plugins Admin to install that plugin) Open a file that’s using your UDL Plugins > EnhanceAnyLexer > Enhance Current Language, which will open EnhanceAnyLexerConfig.ini and create a section in the INI file that matches the name of your lexer. (Example: if your UDL were called “TxoteLanguage”, then the section in the INI would be [TxoteLanguage]) To change the foreground color for anything before a : on a line, you define a regex which matches from the beginning of the line up-to-the-: … For example, to make it red:[TxoteLanguage] 0x000000FF = ^.*?: If you don’t want the : to be red, but just the text before it, use a fancier regex, which requires a colon after but doesn’t include the colon in the match:[TxoteLanguage] 0x000000FF = ^.*?(?=:)

      The INI file includes comments which explain how to set the colors (0xBBGGRR)

    • zeta orionisZ

      installing notepad++ portable zip

      Help wanted · · · – – – · · ·
      • • • zeta orionis
      2
      0
      Votes
      2
      Posts
      41
      Views

      Terry RT

      @zeta-orionis
      Try the online manual here.

      Terry