• Auto Complete feature is not working properly

    15
    1 Votes
    15 Posts
    2k Views
    TuiSilvaT

    @PeterJones said in Auto Complete feature is not working properly:

    Nope. This Forum is about Notepad++, not a generic help forum for programming.

    OK, thanks for letting me know :)

  • using search-replace possibly with wildcards?

    3
    0 Votes
    3 Posts
    454 Views
    Volker MennekingV

    @PeterJones said in using search-replace possibly with wildcards?:

    Template for Search/Replace Questions

    Thank you very much. It funkt.

  • [NppFTP] Cannot start FTP session

    6
    0 Votes
    6 Posts
    445 Views
    Volker MennekingV

    Thank you for this detailed answer. Actually I just needed the correct download link. Sorry, I probably should have asked the question more precisely. The fact is: with release v30.17 Notepad++ works again. Merry Christmas and a Happy New Year

  • Bookmark line becomes unchecked on reopening application

    7
    0 Votes
    7 Posts
    1k Views
    Alan KilbornA

    @Alan-Kilborn said in Bookmark line becomes unchecked on reopening application:

    not sure why this text seems to have a Alt+h keyboard accelerator as I don’t see how you can use it in Notepad++'s UI.

    One more thing I’m not sure of: Why I had said that.
    If a control in the Incremental Search window has input focus, e.g. the Find edit box, then Alt+h will focus and toggle the Highlight all checkbox setting.

  • How do I delete only the second line from multiple text files?

    2
    0 Votes
    2 Posts
    188 Views
    Alan KilbornA

    @한승호

    Find: (?-s)\A.*\R\K.*\R
    Replace: nothing
    Search mode: Regular expression
    Action: Replace-in-Files

  • Bulk Editing Values in XML Files

    4
    1 Votes
    4 Posts
    2k Views
    A

    @Coises

    This is exactly what I was hoping for. Python is well and good, but I haven’t dived into it for good reason. Thanks for letting me know this exists ^.^

  • JSON tools for viewing and editing

    4
    1 Votes
    4 Posts
    92k Views
    Mark OlsonM

    @Austin-Gilliam
    It looks to me like your JSON is a JSON string representation of a JSON array. This means that the parse() RemesPath function (follow that link, then find the parse() function) will help you. It attempts to parse a JSON string, and returns an object that either has result: (the result of parsing) or error: (the error that caused parsing to fail). Note that this function was added in a pretty recent version (v5.5.0), so you might want to get the latest version if that query fails.

    Here’s an image of what we get with your JSON.

    1191f8b3-c9b2-4d98-b544-5511e06b6143-image.png

    As you can see from the treeview on the right, the parse() function worked. Since we know it’s successful, I’ll just change the query slightly, to parse(@).result (which extracts the result value). Now I just click the Save query result button above the tree, and the parsed array is saved in a new buffer. The contents of this buffer will be as follows:

    { "FastenerData": { "508670": {"Item1": "10", "Item2": "50"}, "508674": {"Item1": "10", "Item2": "50"} } }

    By the way, I’m the maintainer of JsonTools, and you can always raise an issue in the repo (linked here) if you need help. But this is a fine place to do it as well.

    @PeterJones
    I’m pleased to see that you noticed the potential of Dump JSON string(s) as raw text in this situation. I was just about to mention it, but I saw you beat me to the punch.

  • batch changing png image to same as filename

    8
    1 Votes
    8 Posts
    576 Views
    Terry RT

    @Coises
    I like it, only issue is you forgot to return the .png in the replacement field. That is unless you meant for the Find What to use a lookahead?

    Just goes to show that although regex can’t count it can be made to do some wonderous things nobody would have believed if they didn’t see it for themselves.

    Terry

  • 1 Votes
    12 Posts
    1k Views
    2

    @mkupper

    Well Tank you very much for the time you have spent on it.
    It was an analysis which I myself did not think of it.

    I don’t have much knowledge in this field maybe browsers or web pages like this use Woff or something like that.

    By the way TYSM.

  • Show/hide the toolbar

    2
    1 Votes
    2 Posts
    2k Views
    Michael VincentM

    @mkupper said in Show/hide the toolbar:

    I have PythonScript 2 installed and so if toggling the toolbar state between hidden and standard is possible then some example code would be great.

    Easy enough:

    notepad.hideToolBar(True)

    To unhide, just pass False instead.

    Cheers.

  • 1 Votes
    2 Posts
    433 Views
    Terry RT

    @Ed-Klein said in If I have multiple desktops active can there be an open Notepad++ window on each:

    Is there a way to start an additional session in each desktop

    There are a number of methods which might help, I will explain them but I haven’t given you all the solution, you will need to complete that yourself based on which idea you decide on.

    Multi-instance mode. That comes with a caveat, last session to close will generally be the one to write the persistent version of config data ready for the next time. So for example if you say you set Dark Mode enabled (Preferences, Dark Mode) and that session is the last to close, then the next time Notepad++ starts Dark Mode will be enabled, even if the other sessions previously did not have it enabled.

    Notepad++ allows for a commandline setting to determine where on the displays it will appear. These are -x and -y settings for the upper left corner of Notepad++. See the online manual here.

    There is also another commandline setting that might alleviate any issues with using multi-session, -settingsDir. So you could elect to have multiple settings directories, one for each monitor/desktop. Each directory would contain all the config files that appear in the normal folder %appdata%\Notepad++. So with this method you would not need to set the x and y coords, rather with multi-instance enabled and using the settingsDir you would open Notepad++, move each instance to the required desktop and then close. On the next opening, the Notepad++ window would appear in the correct monitor. So each shortcut would need to refer to the correct alternate settingsDir

    You could install multiple “Portable Notepad++” installations. In this case updating them is more of a pain since that will overwrite all the config data in each portable installation. Details are here

    I suggest reading up on each, run some tests at the commandline to see which might best help you, then set about creating the right shortcuts to aid in running the preferred method.

    Terry

  • Issues with copy/paste on v8.6

    8
    1 Votes
    8 Posts
    5k Views
    Alan KilbornA

    @mkupper said in Issues with copy/paste on v8.6:

    If you have been used to holding the Ctrl key down in preparation for a Ctrl+C or Ctrl-V then I suspect it’s very difficult to unlearn it.

    When new features are added to software, you have to learn how to use them. Sometimes that involves some unlearning, and yes, that may be difficult. But, in theory, at the end, you are in a better place.

    But with all the bugs with this new feature, we are seemingly far from that “better place”. Hopefully it can all be sorted out and fixed (multi-select mode coexisting alongside column-block-select mode), and hopefully the N++ developer has interest in doing so.

  • "Autohide tabs bar if one document opened"

    6
    0 Votes
    6 Posts
    383 Views
    Alan KilbornA

    Have you tried the script solution that was presented HERE?

    Just noting this: There’s also the case of two views to consider. I suppose if both views were open, that counts as a multiple tab situation, so the tab bar would have to be shown.

  • Convert multiline data to CSV - Regex not working

    9
    1 Votes
    9 Posts
    1k Views
    S

    Thank you to everyone for their input, lots of things to try and I’ll certainly be taking a look at the Json plugin as well.

    Coises comment here in particular kicked me into the right way of thinking…

    @Coises said in Convert multiline data to CSV - Regex not working:

    @Schmill said in Convert multiline data to CSV - Regex not working:

    I’m assuming that the Regex is evaluating the first line, running the replace (which now places line 2 as an append to line 1), but now considers that line 1 is “done”, and moves onto line 2 (which is the old line 3 before the replace joined lines 1 and 2).

    It’s not that (the new) line 1 is done; it’s that the beginning of the old line 2 is no longer the beginning of line, so the ^ doesn’t match.

    Changing my “Find What” to be:
    (.+)\R
    and my replace to be:
    “\1”,

    Means that everything is converted as expected - I had overcooked my regex!

    Many thanks again all!

  • Regex: Find html tags that only contain numbers

    4
    0 Votes
    4 Posts
    465 Views
    Hellena CrainicuH

    I believe I find the solution:

    FIND: <[^>]*>(\d+(\.\d+)?(\s*\w*)*)<\/[^>]*>

  • Opening .cfg by default with Notepad++

    7
    1 Votes
    7 Posts
    6k Views
    CoisesC

    @Julian said in Opening .cfg by default with Notepad++:

    @Coises It opens in normal Notepad when I double-click at the moment.

    If you’re familiar with the registry editor, take a look at HKEY_CLASSES_ROOT\.cfg and see what is there.

    If it has a single value, Default, which reads cfg_auto_file, take a look at HKEY_CLASSES_ROOT\cfg_auto_file.

    If one of those has a shell\open\command pointing to notepad.exe, you could try changing it to the path to Notepad++. No warranties, express or implied, about what happens if you change things in the registry, though… I mean that.

  • How to remove ALL the duplicates WITHOUT deleting the empty lines?

    11
    0 Votes
    11 Posts
    19k Views
    Mark OlsonM

    @guy038 proposed a very simple solution to this, but I have a multi-step solution using no plugins, without having to perform the same find-replace multiple times in a row:

    Make sure Regular expressions are ON in the find/replace form before starting this.

    The document starts looking like this:

    foo bar baz foo foo bar bar baz quz foo Use the find/replace form to replace ^ with \x07. This adds a BEL character (convenient because it does not show up naturally in most text documents) to the beginning of each line. Make a column selection in the first column of every line of the file, then use the column editor to insert a number (with leading zeros to facilitate sorting). This numbers the rows, so they can later be put back in order.
    6e8abd36-ff51-41a8-96d7-7306ab623669-image.png Use the find/replace form to replace (?-s)^(\d+)(\x07)(.*) with ${3}${2}${1}. This puts the column numbers after everything else. Use the menu command Edit->Line Operations->Sort Lines Lex. Ascending Ignoring Case. Now all the lines with the same text are grouped together, and a single regex-replace can get rid of all but the first line with given text.
    3c2274bc-a772-4b8f-8f5d-2f4f7149f143-image.png Find/replace (?-s)^(.+)\x07\d+(?:\R\1\x07\d+)* with ~~~~${0}. This marks the first instance of each line, so that it won’t be deleted later. Note that the ~~~~ in this example should be replaced with some other text that occurs nowhere in your document.
    c755e9c0-d0f2-4c5d-bd1c-cb8a5b008180-image.png Find/replace (?-s)^(?!~~~~).*(\x07\d+) with ${1}. This clears the text but not the line number of any line that does not have the first instance of its text.
    1d2fdb73-56c6-48f7-a59b-0a41ee2181a1-image.png Find/replace ^~~~~ with nothing. This removes the starting marker. Find/replace (?-s)^(.*)(\x07)(\d+)$ with ${3}${2}$1. This brings the line numbers back to the front so that the lines can go back in order. Use the menu command Edit->Line Operations->Sort Lines Lex. Ascending Ignoring Case. Now all the lines are back in their original order.
    15e0de09-df0e-4c9a-97b7-0e0314d296dc-image.png Find/replace ^\d+\x07 with nothing. This removes the line numbers and separator.

    Finally, you are left with the original document with the non-first instances of each line’s text replaced with nothing! A lot of steps, but every step is highly scalable and won’t exhibit bad performance on very large files.

    foo bar baz quz
  • Regex - Find URLs with Embedded Spaces

    4
    0 Votes
    4 Posts
    692 Views
    PeterJonesP

    @Terry-R said in Regex - Find URLs with Embedded Spaces:

    has already made some posts here.

    And as slightly more of a hint: the search zone would begin with href=" and end with " . (If you tried the simpler begin with " , you would find that it would sometimes match between the end of one URL and the beginning of the next, and it wouldn’t work, which might frustrate you; the zone-matching works best when the start and end markers can be distinguished.)

  • Regex Custom UDL Parser

    7
    2 Votes
    7 Posts
    578 Views
    Khundian TwitchK

    @PeterJones

    You’re a star! That looks awesome!
    If you’re ever in Belgium I owe you some beers! :)

  • Why Carets?

    6
    0 Votes
    6 Posts
    1k Views
    Dave RowlandsD

    According to Encyclopedia MDPI

    The caret was originally and continues to be used in handwritten form as a proofreading mark to indicate where a punctuation mark, word, or phrase should be inserted into a document.[1] The term comes from the Latin caret, “it lacks”, from carēre, “to lack; to be separated from; to be free from”