• Find & Replace sets of value with an unique of values

    5
    0 Votes
    5 Posts
    955 Views
    Luigi Giuseppe De FranceschiL

    @alan-kilborn no problem :)

    i applied a brute force approach and now i hope my xml will work:

    step 1) find <relationship and replace with <relationship>FYY ( *
    step 2) find source and replace with ) source *
    Step 3) find (?-s)(?-i:<relationship>|(?!\A)\G).?\K(?:\x20(.+?)) with identifier=“id-999999”
    Step 4) find >FYY and replace with " "
    Step 5) find <connection and replace with <connection>FYY
    Step 6) find relationshipRef and replace with ( relationshipRef
    Step 7) find (?-s)(?-i:<connection>|(?!\A)\G).?\K(?:\x20(.+?)) and replace with relationshipRef=“id-999999”
    Step 8) find >FYY and replace with " "
    Step 9) find ) source and replace with source

    am i mad? :D

  • Replace sets of numbers in a given position with 0

    4
    0 Votes
    4 Posts
    327 Views
    Fernando BernabeuF

    @neil-schipper
    Thank you very much! That worked wonderfully!

  • Add the same amount to every selected value?

    23
    0 Votes
    23 Posts
    6k Views
    guy038G

    Hello, @diz-hydron and All,

    Well, @diz-hydron, I suppose you could begin with this very simple script, named diz.py

    def player_1(m): return str(int(m.group(1)) + X1) + ', ' + str(int(m.group(2)) + Y1) def player_2(m): return str(int(m.group(1)) + X2) + ', ' + str(int(m.group(2)) + Y2) editor.rereplace('"player1": \\[\K(-?[0-9]+), (-?[0-9]+)', player_1); editor.rereplace('"player2": \\[\K(-?[0-9]+), (-?[0-9]+)', player_2);

    Before running the script, of course, change the X1, Y1, X2 and Y2 values for true positive or negative integers ( e.g. +7 or -3 )

    It should work nicely with your text posted here

    In a next step, it would be better to enter the different values with, for instance, the notepad.prompt python command and assign the 4 typed numbers to the X1, X1, X2 and Y2 variables…

    Best Regards,

    guy038

  • Get back MS NOTEPAD

    3
    0 Votes
    3 Posts
    335 Views
    PeterJonesP

    @dave-venus ,

    If you mean “When I double-click a .txt file, it opens with Notepad++ instead of MS Notepad”, then that does automatically happen when you install Notepad++. To undo it, use your Windows Operating System’s method of changing your file association – probably easiest is to right click on the .txt file, Open With, choose MS Notepad, and check “always open this type” or however it’s phrased in your exact version of Windows. (Note, these instructions aren’t unique to Notepad++ – any time you install a new file editor, it almost always changes the default association for one or more types of files, and if you don’t want that behavior, Open With is the way to re-associate it with your previous application.)

    However, if, like @Lycan-Thrope assumed, you try to run notepad.exe directly (double-click on the executable, or use the Windows Run dialog and type notepad.exe) and it instead runs Notepad++, then you have done something odd at some point: probably, either you intentionally used the notepad replacement instructions – in which case you need to undo those – or you installed the “NotepadStarterPlugin”, in which case you need to follow the “Uninstallation” instructions on that plugin’s page.

  • By regular expressions

    2
    0 Votes
    2 Posts
    232 Views
    Neil SchipperN

    @yuliya-drimmer I don’t think a general solution where you specify the number of after-lines is possible.

    As you may know, a regex that matches a word and then removes line separators for a specific number of after-lines is possible. Hence, if the range of required after-lines is not too big, a family of regexes that supports the overall need could be made.

  • Replacing a number with line number in text

    2
    0 Votes
    2 Posts
    819 Views
    Neil SchipperN

    @yosef-ymj Hi. I suggest you learn to use Edit -> Column Editor (Alt+c) to insert a column of ascending numbers.

    Then, learn to use Alt+MouseMovement to select rectangles, and gain skill with rectangular cut/copy/paste operations.

    When working with rectangles, these are also helpful:

    Shift+Alt+ArrowKey to adjust dimension Shift+Alt+LeftMouseClick to specify opposite corner of a rectangle whose other corner is current caret position

    If your data is as uniform as shown, a sequence using the above operations will do what you want, although you may need to handle 1, 2 and 3 digit sections separately.

    To review some creative solutions to rectangular text problems, use the magnifier icon and search this site for terms like “column editor rectangle paste”.

    Drop a follow-up comment to indicate whether you succeeded.

  • Dark Mode Switch

    2
    0 Votes
    2 Posts
    598 Views
  • removing characters

    4
    0 Votes
    4 Posts
    314 Views
    Robert CarnegieR

    @kracovwolf I think you will want to use “Search Replace” with “Search Mode” of “Regular Expression”.

    This is a very complicated option, but what you specifically need to do is simple:

    ^J
    means “J at the start of a line” in Regular Expression language. You can replace this with nothing. From your example, you should replace “J space” which is also there.

    It will not remove the start of line. It will only remove J or remove J space.

    J$
    means “J at the end of a line”.

    Doing one and then the other is simplest.

    It will still be your responsibility to not remove more J s than you want to.

  • Win11 pinned taskbar icon middle click = new document

    4
    0 Votes
    4 Posts
    992 Views
    Robert CarnegieR

    @martin-olsson This is a possible candidate for using a third-party “macro” program to create specific behaviour on your computer. I use a downloaded tool called “AutoHotkey” but I haven’t created with it recently.

    As far as I remember, things that an AutoHotkey macro can do include:
    Read the title bar of a program
    Bring a program (Notepad++) to foreground and out of being minimized
    Send a keystroke to a program (Ctrl N new document)

    So you could have an icon on your screen that does all of that from one click.

    Other options are possible, such as always waiting for YOU to foreground Notepad++ and THEN send Ctrl N each time, or, to see if the title bar says “new” for a newly created document already.

    Or it could just make your middle mouse button send Ctrl N.

  • Find & Replace LF not working across whole document

    8
    0 Votes
    8 Posts
    2k Views
    Robert CarnegieR

    @by-eck I’m late to this, but I wonder if Notepad++ is the right tool for this job. If you have to do it more than once - a simple automatic text editor like “sed” would be more suitable.

    It also resembles work I’ve had to do to copy database data to a format that pastes into Microsoft Excel out of “SQL Server Management Studio”. In that case, I wrote a fairly simple SQL user-defined function, whose output is what I want Excel to receive, starting with changing ‘01’ to =“01” so that Excel displays 01 instead of the number 1 - but also removing in-data line breaks and tabs and anything else that annoyed me. Oh, I think it fixes dates. So the output of the data process didn’t contain those hiccups.

    I did that as paid work so I guess my employer owns it, but they may agree to sharing it with the world. Would you like me to ask?

  • Plus to the right of tabs = new tab

    12
    1 Votes
    12 Posts
    4k Views
    rddimR

    The current state is:

    Double click on “blank” area - open new tab Wheel click on tab - close the tab

    What about if we have selectable options for double and wheel clicks?

    For example:

    Double click on blank area and/or tab: Open new tab Close the tab (it is already available in the preferences) Wheel click on blank area and/or tab: Open new tab Close the tab (already available but not configurable)

    The current possible actions are - double click for new tab/close current and wheel click for close.
    The new will be to choose what double click and wheel can do.
    Also will be good if the user can open new tab next to the current when double/wheel click on the current one.

    By the way in the Document List double click works only to open new document, but not to close it. Wheel click also does not work.

    PS: I don’t like the idea to have [+] button because there is already a button for new tab

  • Pinning/Locking a Tab

    13
    2 Votes
    13 Posts
    15k Views
    PeterJonesP

    @alan-kilborn ,

    Sometimes, I do have a sharp wit.

  • Regex: Add html tags in the lines that doesn't have html tags

    12
    0 Votes
    12 Posts
    2k Views
    Robin CruiseR

    @guy038 said in Regex: Add html tags in the lines that doesn't have html tags:

    SEARCH (?s-i)^.+<!-- ARTICOL START -->\R|<!-- ARTICOL FINAL -->.+|(?-s)^(<p class="mb-40px">)?(?|(.+)(</p>)|(.+))$
    REPLACE ?2(?1:<p class="mb-40px">)$0(?3:</p>):$0

    great answer, thank you @guy038

  • Search result window NOT stay on top ?

    3
    0 Votes
    3 Posts
    862 Views
    PeterJonesP

    @Asger-Jørgensen-0 ,

    It was pointed out to me that you said “search results window”. My mind couldn’t conceive of anyone undocking the search results window, so it autocorrected it to “find dialog”.

    If you don’t want it in the way, dock it, which is its natural state. Or, if you don’t want it docked, move it outside of the Notepad++'s main window.

    If that’s not sufficient, then the feature-request FAQ I already linked is your next step. (Or someone else might come and suggest something.)

  • Problems in user account

    2
    0 Votes
    2 Posts
    207 Views
    PeterJonesP

    @asger-jørgensen-0 ,

    I have not received a confirmation mail.

    Some people have difficulty receiving the confirmation mail. But that mail isn’t 100% critical: it might mean that the Forum cannot email you notifications regarding replies to your questions… but other than that, you have 100% access to the main features for the primary purpose of the forum – posting and replying to questions and discussions.

    This profile is Asger Jørgensen 0 and the old one is Asger Jørgensen.
    Can somebody fix this ?

    Unfortunately, I don’t have enough moderator power to investigate issues with accounts / access / etc. I was hoping that one of the other, more powerful moderators was going to reply to you, but it doesn’t look like they ever did (though maybe someone contacted you through a private message or through email).

  • please color between "style" tags in php sheets

    2
    0 Votes
    2 Posts
    576 Views
    PeterJonesP

    @djeydjey95 ,

    I saw you also asked here… you only need to do each question once (though the lack of replies might convince you otherwise).

    In case you weren’t aware, there is a regression/bug in v8.4 that messed up HTML-formatting-in-PHP-files. more here. If that’s what you are having difficulty with, please try with Notepad++ v8.4.1, which should have fixed that bug.

    If you are asking for something else, please explain it better, as I obviously couldn’t understand, and no one else here has understood it enough to provide guidance.

    If you are asking for a new feature that’s not previously been available, we have a FAQ for that, because feature requests posted solely in the Community Forum will not be addressed, because this isn’t the bug/feature tracker.

  • Can't open user-defined language folder

    3
    0 Votes
    3 Posts
    6k Views
    castortechC

    @peterjones

    Thanks for the very informative reply. I ended up with a cloud setting that I don’t remember ever using but maybe a result of an experiment at some point. Removed that and all is back to normal.

    Thanks so much, really appreciated.

    Alain

  • Function list for JavaScript in HTML

    4
    0 Votes
    4 Posts
    683 Views
    PeterJonesP

    @dean-tersigni ,

    One could copy the JavaScript FunctionList definition file overtop the HTML FunctionList definition file, but that would of course lose the normal HTML FunctionList behavior.

    Alternate to that, one could try to merge the regexes in the FunctionList definition to try to get a combination of the two behaviors in the HTML FunctionList definition… but that would not necessarily be easy to do

  • A mode to show opened files are saved or not?

    5
    0 Votes
    5 Posts
    601 Views
    Alan KilbornA

    @peterjones said in A mode to show opened files are saved or not?:

    That’s why that feature was added. (Personally, I wish the “alternate” icons were made the primary/default, but at least the option is there.)

    Don’s philosophy is that new optional behavior is never the default. To me it would be better the other way around: If something better/fresher is made the default, users know about it; those that don’t like it (sometimes people just hate change, even when what has been changed is better) can always change it back. The way it is, I’m sure a lot of good new behavior is unbeknownst to a lot of users.

  • -1 Votes
    9 Posts
    632 Views
    guy038G

    Hi, @robin-cruise,

    The (?-i) part means that, from thiat point, the search will be sentitive to case. So, it will match the string <p class="sd-23">, but not, for instance, the string <P class="sd-23"> nor the string <p CLASS="sd-23"> !

    Then, the \h class character represents any horizontal blank character ( so, either, the \t [ Tabulation ] char or the \x20 [ space] char or the \xa0 character [No-breaking Space] char)

    Thus, the \h* syntax represents any range of horizontal blank chars, from 0 to n

    BR

    guy038