• How to find and replace the last occurrence of a tag ?

    6
    0 Votes
    6 Posts
    218 Views
    dr ramaanandD

    @guy038 Oui, merci beaucoup!

  • I want to automate editing a json config file?

    2
    0 Votes
    2 Posts
    176 Views
    PeterJonesP

    @Matty-Lad,

    It depends on how automatic you want it.

    If you are willing to open Notepad++, open the file, and run a macro to do a replacement, that can be done with native Notepad++ (see below).

    If you want to have notepad++ already open, but have it automatically open the file, you cannot do that in a macro; however, you could install a scripting plugin like PythonScript, and do something that automatically opens the file, runs the replacement, saves, and closes the file again.

    If you choose to go the macro route, you can setup the Macro using the following sequence:

    Macro > Record Macro Search > Replace
    FIND WHAT = "sparse_infill_pattern": "gyroid"
    REPLACE WITH = "sparse_infill_pattern": "gyroid"
    SEARCH MODE = Normal
    REPLACE ALL File > Save Macro > Stop Recording Macro > Save current recorded macro Give it a name, like BambuGyroid Optionally, give it a keystroke that you can remember OK

    From now on, using Macro > BambuGyroid (or the keystroke you chose) will run that specific replacement and save.

  • the html codes don't work:

    10
    0 Votes
    10 Posts
    4k Views
    PeterJonesP

    @Ashley-Smith ,

    its people like you that take a forum for learning and taint it

    I am sorry you feel that way. @essa-gamer thought my reply was enough to say “thank you”, so I’m not sure the original poster agrees with you. (Though, admittedly, it was pretty cryptic, as @Alan-Kilborn mentioned, and we don’t know which answer, specifically, was replied to with “thank you”)

    I actually care so much about learning that after coming here years ago and getting one good answer to my question, I decided to hang around and answer questions; over the years, I have answered thousands of questions, most of them to the original poster’s satisfaction (based on their direct comments, and them upvoting my answer), spending large portions of my free time helping other people, because I love Notepad++ so much and want to help others learn how to use it. Over that time, a percentage of users haven’t liked the way I occasionally answer, but the same happens any time any person is trying to help others in any public forum – it’s not just me, and it’s not just here. If I didn’t care about helping other people learn, I would have been gone years ago.

    WHEN WE ARE TYPING OUT OUR HTML CODES AND WE ARE SAVING THEM ACTIVELY AFTER ADDING MORE HTML AND CSS? It is not refreshing on the browser…

    Oddly enough, that’s not the only interpretation of the original question. I listed answers to multiple interpretations of the question, five years ago.

    But I’m going to assume that’s your question, so I will do my best to guess at your circumstances, and try to help you learn.

    If your browser has opened the local copy of the file (so it shows something like file://C:/blah/blah/blah.html in the URL address bar, then you just have to Refresh your browser (often Ctrl+R or F5, depending on browser) after you save in Notepad++ – but that’s not a Notepad++ question, because the same would be true no matter what editor you used to edit and save the html file.

    If you do that, and it still doesn’t match, you need to make sure that the path listed in the browser is the same as the path that Notepad++ has open – if Notepad++ saved to a different location, the browser won’t be able to see it.

    If your browser has an https://blah.blah.blah/blah/blah.html in the URL address bar, then you need to upload your file from your local machine to the webserver (as per my “to upload the file to a webserver” paragraph from five years ago) before the browser will be able to see the updates.

    Does this help you, or are your circumstances different than I’ve guessed?

  • Updation

    3
    0 Votes
    3 Posts
    127 Views
    dr ramaanandD

    @PeterJones Okay, thank you!

  • Convert XML data to tabular csv data or tab separated without a script

    14
    2 Votes
    14 Posts
    14k Views
    Kristijan BertaK

    For converting XML to CSV, I have written a blog post that outlines comprehensive methods, including flattening simple XML and normalizing complex, nested XML structures. It discusses multiple approaches, such as using Flexter for complex cases. Additionally, if you’re dealing with sensitive data, the Paranoid tool can help anonymize data before conversion. This makes it a practical solution for handling XML that contains private or confidential information while still achieving the necessary format transformation.

    If you want to find out more contact me or send me a direct message

  • inserire virgola e 1

    4
    0 Votes
    4 Posts
    153 Views
    massimo la terraM

    @Alan-Kilborn che bella la community grazie

  • disable Update Notification or silent Update

    2
    0 Votes
    2 Posts
    169 Views
    gerdb42G

    @endurance0
    You may want to have a look at https://npp-user-manual.org/docs/command-prompt/#installer-options. Maybe options /noUpdater and /S provide what you are looking for.

  • How to wrap selection by strings on both ends?

    7
    0 Votes
    7 Posts
    360 Views
    P

    @Alan-Kilborn: Thanks a lot! Being fluent with Python, I have installed the PythonScript, and I am learning first steps.

  • Bookmark folder locations

    5
    0 Votes
    5 Posts
    219 Views
    PeterJonesP

    @Edward-Wilson ,

    Can I ask something?

    There’s no reason to ask if you can ask, as it wastes everybody’s time (including yours – if you had already asked it, people could already be formulating an answer to your actual question, rather than spending time telling you that you can ask Notepad++ questions in a Notepad++ forum). If it’s an on-topic question about Notepad++, then go ahead and ask; if it’s not about Notepad++, then the obvious answer is no, you should not ask it in a Notepad++ forum.

    If your question is about bookmarking folder locations, you can ask it by replying to this Topic, like you did for your first post. If it’s about some other aspect of Notepad++, then either hit the New Topic button in the main Help Wanted section to ask a new question, or reply to an existing Topic that your question is specific to.

  • Format name and password from vertical to horizontal

    2
    0 Votes
    2 Posts
    210 Views
    PeterJonesP

    @gomasafrat ,

    The forum has a post-queue to prevent spammers: the post-editor told you this as you were creating your post. You don’t have to post it twice just because you didn’t see it show up visibly. I used moderator power to only approve the first version you posted, not the second version,

    Please use the </> on the post toolbar for marking your example text as “code”, which makes sure that the forum puts it in the box and doesn’t interpret text as formatting codes. I used moderator power to add in the markdown for you, so that people could read your text to help you, but in the future, you need to be the one to make your post readable.

    I cannot tell whether you really meant for there to be blank lines between each line of text, or if that was some artifact of the way you entered the text. You need to clarify this, otherwise the answers we give might not work for your actual data.

    I cannot tell whether you really intended for the word PASSWORD to be squished together with the username’s value in the first possible output format; if that’s what you want, it seems like a horrible idea to me, so I will assume you don’t actually want it that way.

    From a data security standpoint, you should never store passwords in plain text. If you are, you are either asking hackers to steal your list of passwords, or you are a hacker who has already hacked some site. The first is highly insecure, the second is immoral and likely illegal. I will assume this is just an example set of data, where you are trying to learn how to do that, and that you are neither practicing insecure behavior nor criminal behavior.

    Possible solution:
    FIND = (?-s)^(USERNAME=.*)\R+(PASSWORD=.*)$
    REPLACE = $1 $2
    SEARCH MODE = Regular Expression
    REPLACE ALL

    This should work whether or not you have the extra blank lines between each line.

    quick explanation:
    FIND:

    (?-s) = makes sure you are not in . matches newline mode, no matter what the setting is in your REPLACE dialog ^ = matches beginning of the line (so USERNAME= must be at the start of the line, no blank space or other characters before it (...) = store whatever is matched inside in a group for the replacement. There are two of these, so you have group1 and group2 .* = match 0 or more of any type of characters \R+ = match 1 or more newline sequences $ = match the end of the line, so group2 will go all the way to the end of its line

    REPLACE:

    $1 = use the contents of group1 $2 = use the contents of group2 since the newline sequences between the groups weren’t in any group, they won’t end up in your replacement

    The references below – especially the User Manual’s regex docs – will help you learn more about regular-expression searching.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • can't install plugins

    7
    0 Votes
    7 Posts
    441 Views
    Narwhals MustBeSavedN

    @Coises I figured it out! I had to put the DLL in the plugin folder and then install the plugin from notepad++ that way

  • 0 Votes
    2 Posts
    157 Views
    PeterJonesP

    @Kyung-Sik-Yang ,

    You provided a screenshot, but I am doubtful any of of the regulars here have enough experience with Korean to understand what you seem to think is wrong with the above. Maybe a better description will help.

    But I will try some wild guesses, to see if I can be of some help to you.

    Assuming you are trying to show that a few of the glyphs on the left are showing up as a ? in Notepad++:

    if you did a bad encoding conversion, where the destination encoding didn’t have a codepoint for your source character. For example, if you took text ☺ U+2640 SMILE, and tried to use Encoding > Convert to ANSI, it would change from
    395a185d-610f-4a8b-ae32-42fa7d7fbda1-image.png
    to
    ? `U+2640` SMILE
    3b7eb59d-6e7c-47de-ad46-4d3d1c193647-image.png
    because there is no glyph in ANSI for the ☺ smile character. Similarly, if you tried to paste that text into a file that was already an ANSI file, it would do the same conversion to ? `U+2640` SMILE so maybe you are trying to convert text into or paste text into an encoding that doesn’t have a codepoint for the Korean character that becomes the ? Or maybe your chosen font for Notepad++ doesn’t include glyphs for those characters (but I think it would be an empty square box, not a question mark). Using Settings > Style Configurator > Global Styles > Default Style to pick a different font which you know has that glyph might solve the problem. (Or maybe changing the Settings > Preferences > MISC > ☐ Use DirectWrite and restarting Notepad++.) Or maybe it is showing something like one�two – which would indicates that it was trying to decode some bytes from your file as a unicode character, but it wasn’t a valid unicode character, so it displays the � symbol to indicate a data input problem. This might indicate that your original file has some bad bytes (either because something was corrupted, or because the application that created your text file made a mistake).
  • 0 Votes
    9 Posts
    295 Views
    Mark OlsonM

    @PeterJones said in Merge local with external changes when file is modified by another program:

    Doesn’t the existing action Diff since Last Save essentially do that already?

    I can confirm that this is in fact exactly what Diff since Last Save in ComparePlus does, making it totally unnecessary to create an NPPN_FILEBEFORERELOAD notification or do anything I suggested in my above post.

  • how to replace data in notepad++ tab with respect to other tab data?

    3
    0 Votes
    3 Posts
    157 Views
    guy038G

    Hello, @genjua-khan, @peterjones and All,

    @genjua-khan, in addition to the @peterjones’s solutions, may be the following Python script could interest you !

    The explanations, regarding the use of this script, are included in comments

    Note that the RULIC name of that script means Replace Using List In Clipboard !

    ''' Based on : https://notepad-plus-plus.org/community/post/33977 ( Scott Sumner - August 2018 ) - Given a NEW tab, containing some lines, with the FORMAT : DELIMITER<Searched_Text>DELIMITER<Replacement_Text>, PASTED in the CLIPBOARD by a 'CTRL--C' action - This script REPLACES any 'Searched_Text' ( of a 'CLIPBOARD line' ) with its CORRESPONDING 'Replacement_Text', in CURRENT file ( ACTIVE tab ) EXAMPLE : Let's suppose that the THREE lines, below, are pasted in the CLIPBOARD : !bar!foo $Test$ :Bob:Ted Then : - Any 'bar' string will be changed by 'foo' in the present ACTIVE tab - Any 'Test' string will be DELETED in the present ACTIVE tab - Any 'Bob' first name will be changed by 'Ted' in the present ACTIVE tab NOTES : - IF the 'Replacement_Text', after the DELIMITER, is ABSENT, the 'Searched_Text' is then DELETED - The DIFFERENT strings, to search for, are ALWAYS supposed to be LITERAL strings - The DELIMITER may be DIFFERENT between TWO successive lines - The list of the different SEARCHES [ and REPLACEMENTS ], with the DELIMITERS, must be PRESENT in the CLIPBOARD, RIGHT BEFORE running this script ''' import re def RULIC__main(): if not editor.canPaste(): return cp = editor.getCurrentPos() editor.setSelection(cp, cp) # cancel any ACTIVE selection(s) doc_orig_len = editor.getTextLength() editor.paste() # Paste so we can get easy access to the clipboard text cp = editor.getCurrentPos() # The POSITION has moved because of the PASTE action clipboard_lines_list = editor.getTextRange(cp - editor.getTextLength() + doc_orig_len, cp).splitlines() editor.undo() # Revert the PASTE action, but sadly, this puts it in the undo buffer...so it can be redone editor.beginUndoAction() for line in clipboard_lines_list: try: (search_text, replace_text) = line.rstrip('\n\r')[1:].split(line[0]) except (ValueError, IndexError): continue editor.replace(search_text, replace_text) # DEFAULT search is SENSITIVE to case #editor.replace(search_text, replace_text, re.I) # If an INSENSITIVE search is preferred editor.endUndoAction() RULIC__main()

    Best Regards,

    guy038

  • unexplainable message

    7
    1 Votes
    7 Posts
    309 Views
    PedroxinatorP

    Hi,
    this is only to report how I solved the problem.
    First I restored a system image from before installing Npp.
    Then I installed Npp and tested the “replace notepad” hack mentioned b Peter Jones above. The result was that it really worked very fine for me. There was only 1 small disadvantage: the kontext-menu new didn’t offer me the creation of a txt-file anymore…
    Okay, again I restored the system, and installed Npp again. And now I installed the already mentioned NotepadReplacer. Surprisingly it was (and still is!) working like a charme. It really replaces the “normal” Windows Notepad in an incredible way. Even when starting the original Windows notepad by doubleclicking the notepad.exe it starts Npp. Incredible!
    As per today’s status I only can recommend this piece of FREE software.
    That’s it.

  • Replace & add specific parts/symbols from a specific lines only

    3
    1 Votes
    3 Posts
    165 Views
    guy038G

    Hello, @flammable and All,

    First, I would advice you to fully read this interesting FAQ post below, which explains to prefer the use of a JSON parser ( instead of regexes ) for such problems :

    https://community.notepad-plus-plus.org/topic/25304/faq-parsing-and-editing-json-with-regex-is-a-bad-idea/1?lang=fr

    Oh,…, by moving to your post, I just see the @mark-olson’s reply which explains a straight solution, based on the JsonTools plugin ;-))

    However, I also succeeded to find out a regex way to do it !

    So, given your INPUT text, below, in a new tab :

    "water": { "DisplayName": "Water", "Skin": 0, "Image": "water.png", "DefaultAmount": 1, "BlockAmountChange": false, "BuyPrice": 5000, "SellPrice": 0, "Currency": "eco" }, "healingtea.advanced": { "DisplayName": "default", "Skin": 0, "Image": "healingtea.advanced.png", "DefaultAmount": 1, "BlockAmountChange": false, "BuyPrice": 500, "SellPrice": 0, "Currency": "eco" },

    Open the Replace dialog ( Ctrl + H )

    Untick all box options

    SEARCH (?-is)^\x20+"Image":\x20"\K

    REPLACE https://www.example\.com/example2/

    Check the Wrap around option

    Click, once, on the Replace All button ( NOT the Replace button ! )

    You should get this OUTPUT text :

    "water": { "DisplayName": "Water", "Skin": 0, "Image": "https://www.example.com/example2/water.png", "DefaultAmount": 1, "BlockAmountChange": false, "BuyPrice": 5000, "SellPrice": 0, "Currency": "eco" }, "healingtea.advanced": { "DisplayName": "default", "Skin": 0, "Image": "https://www.example.com/example2/healingtea.advanced.png", "DefaultAmount": 1, "BlockAmountChange": false, "BuyPrice": 500, "SellPrice": 0, "Currency": "eco" },

    Now with the following regex S/R, we’ll change any dot character, not followed by the string png", at end of line, with a dash char :

    SEARCH (?-si)(?:^\x20+"Image":\x20"https://www.example.com/example2/|(?!\A)\G).*?\K\.(?!png",$)

    REPLACE -

    Just follow, exactly, the same other points of the previous S/R !

    You should get your expected OUTPUT text :

    "water": { "DisplayName": "Water", "Skin": 0, "Image": "https://www.example.com/example2/water.png", "DefaultAmount": 1, "BlockAmountChange": false, "BuyPrice": 5000, "SellPrice": 0, "Currency": "eco" }, "healingtea.advanced": { "DisplayName": "default", "Skin": 0, "Image": "https://www.example.com/example2/healingtea-advanced.png", "DefaultAmount": 1, "BlockAmountChange": false, "BuyPrice": 500, "SellPrice": 0, "Currency": "eco" },

    BR

    guy038

  • Change or specify plugins directory or folder location

    5
    0 Votes
    5 Posts
    5k Views
    PeterJonesP

    @rsonnier-cfs ,

    If NPP used %appdata% for the dll

    FYI: Feature requests cannot be processed here. We can only give our opinions or other feedback on a given request, but making a request here will not put it into the feature-request queue for the developers to look at. Our FAQ explains this.

    If NPP used %appdata% for the dll

    Prior to v7.6 (in 2018), plugins used to go in the %AppData%\Notepad++\plugins\ directory.

    However, there were a lot of (valid) security complaints, and Notepad++ would have been essentially blocked from being installed in many corporate environments because it read executable code from the user-writeable %AppData% hierarchy. The developer didn’t want much of the corporate world to lose access to Notepad++, so in v7.6.3, Notepad++'s plugin interface was finalized to only allow plugins in the plugins\ directory off of the executable’s directory.

    Given the security implications (and the massive loss of userbase if the developer ever enabled running DLL code from %AppData%\ again), I doubt any such feature request would ever be implemented (even as an option: if there is an option to configure Notepad++ to run DLL code from an insecure location, then the security hole exists, and the large userbase would be cut off from being able to use Notepad++). So, even if you were to ask for the feature in the right place, I would give it close to 0% chance of being implemented.

    If you want a workaround, you could unzip a separate portable-zipped copy for each user into whatever directory structure you wanted, and then they’d each run out of that copy, and it would use the <portabledir>\Notepad++\plugins\ hierarchy for installing plugins, and thus there would be no conflict.

    I am unable to easily copy the latest (v6.24.10) dll in the folder since the .dll is always in use by several users; that is unless I ask everyone to close NPP

    The reason you cited is equally applicable to saying that Notepad++ itself cannot be updated while any users are using it. Unless you never update Notepad++ (which has security and performance and feature implications), then whatever window you use for updating Notepad++ could also be used for updating the plugins.

    I highly encourage you to regularly update Notepad++.

    If you want to get into the specifics on why SQLinForm is locking up when you try to make configuration changes, that is something that maybe someone in this forum could help you with. (I don’t have any experience with that plugin, but can give some generic statements.)

    Plugins should have their configuration files in %AppData%\Notepad++\plugins\Config\ hierarchy, so just editing the configuration shouldn’t cause it to crash. Having multiple people using the DLL simultaneously shouldn’t change that (because they are presumably each executing it in a separate process), so I don’t see how any “lock” on the DLL file itself could in any way cause the instability you described. Unless SQLinForm plugin doesn’t use standard config file location and is trying to have some common config instead of per-user config, I don’t know how the location would affect things (and if they are doing that, your proposed change to the DLL location wouldn’t change their coding of a central config file, so wouldn’t help if that were the culprit.)

    However, if there is a bug in an older copy of SQLinForm in general, which has nothing to do with DLL location, then you would necessarily need to do the upgrade to get it to work, regardless of whether the DLL is in a central location.

    At this point, any possible fix will require making the users exit out of Notepad++ for some amount of time simultaneously: if the Notepad++ executable were changed to allow DLLs in the AppData (no matter how unlikely it actually is), they would have to exit so you could update the .exe; if you wanted to make a bunch of portable copies, on for each user, they’d have to stop using the centrally-installed exe and switch to their own portable exe; and if you just do an upgrade of the DLL now, they will have to stop.

    Or maybe NPP is simply not supported of RD server.

    It’s not specifically designed for multiple simultaneous users in a remote-desktop environment all running separate copies of the same executable, no. Notepad++ has the multi-instance mode, but it’s more focused on allowing a single user to have multiple windows of Notepad++ open simultaneously (for those for whom the two Views in the same window aren’t sufficient or not their preferred window setup)… but multi-instance has always had some drawbacks compared to single instance… and you’ve just found a rather unique use case showing yet another such drawback.

  • changing text in a table

    2
    0 Votes
    2 Posts
    115 Views
    PeterJonesP

    @fra-Do ,

    Your question is very vague, and I am uncertain how it is specific to Notepad++.

    In general, to change text, you move the cursor and type.

    Are you asking how to do a search-and-replace? Or something else?

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • Cursor not working properly

    5
    0 Votes
    5 Posts
    437 Views
    Alan KilbornA

    @Mainak-Gupta said in Cursor not working properly:

    I want to bring back the vertical option which is ‘|’

    It’s probably just as simple as pressing the Insert or INS key.
    But if it isn’t, all the information you need to “bring it back” is in Peter’s posting already.

  • Problems opening and saving files from a linux server - keeping LF EOL

    2
    0 Votes
    2 Posts
    196 Views
    PeterJonesP

    @Bob-Southwell ,

    When Notepad++ opens a file, it decides on the file’s EOL format based on the first line ending it sees: if the first line ending is CRLF, then it will choose Windows EOL format; if the first line ending it sees is LF, it will choose Unix (LF) as the EOL mode.

    Thus, if Notepad++ is opening the file in Windows EOL format, I am quite confident that the first EOL was CRLF, not just a linux LF.

    That said, I believe that WinSCP, like other FTP clients, can be configured to automatically convert line endings… so my guess is that it’s converted the line ending when it did the transfer, and that your problem has nothing to do with Notepad++ behavior. (If you don’t want WinSCP to do the conversion, look for settings to put it into “binary” mode instead of “ASCII” mode, or some such. Or set it up so it does the conversion in both directions, so that Notepad++ can edit it Windows EOL but WinSCP changes it back to Linux EOL when it sends it back to the server.)