• Document does not scroll when holding F3

    4
    0 Votes
    4 Posts
    279 Views
    Antoni RoszakA

    Hi,

    I have uninstalled the Horizontal Ruler, and updated XMLTools to 3.1.1.13, and it’s still incorrect. This is a large XML file, 57 MB, 1.7 million lines. With a smaller file (87k lines) it works fine.

    I have narrowed it down a bit; apparently, the problem occurs when the number of lines between occurrences is large. I cannot share the original file itself for privacy reasons, but I got the path:

    take file “C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2911.0\Microsoft.DirectX.Direct3DX.xml” copy everything between second and penultimate line, 20 times (I got 270k lines) search for “Microsoft.DirectX.PrivateImplementationDetails.”, normal mode hold F3
  • Font for space character in User Definded Languages

    3
    0 Votes
    3 Posts
    481 Views
    Alan KilbornA

    @peterjones said in Font for space character in User Definded Languages:

    Personally, if I have a monospace font and size that I want, I want it on all my Languages, not just one UDL (I don’t see a reason in a text editor to ever use a non-monospace font, and I don’t see a reason for having Courier New in C++ but Consolas in Visual FoxPro and DejaVu Sans Mono in Perl, or some wacky combination like that). So I just set my StyleConfigurator>GlobalStyles>DefaultStyle to the one font to rule them all (DejaVu Sans Mono, of course). But Notepad++ is supposed to be highly configurable to handle everyone’s tastes, so I am not trying to force you to agree with me.

    Yes, but smart people will agree with you.
    And I agree 100% with all of this.

  • Regex find/replace EOL except if..

    3
    0 Votes
    3 Posts
    270 Views
    Mech MonM

    @peterjones thank you yes exactly what I was looking for. I did have the period escaped, but was not clear about the positive/negative look ahead/behind. I didn’t RTFM close enough.

  • Save on Exit vs Periodic Backup

    2
    0 Votes
    2 Posts
    279 Views
    PeterJonesP

    @manu-rozier ,

    You might find that the AutoSave plugin gives you more control of the automatic saves. We have a FAQ comparing the plugin vs the periodic backup.

  • How to disable ctrl+g and 8.2 ?

    2
    0 Votes
    2 Posts
    265 Views
    Alan KilbornA

    @александр-сухоруков

    Go to the Settings menu and choose Shortcut Mapper. Locate Ctrl+g:

    a83b4292-3405-44fb-aa4c-1831ae0e30fc-image.png

    and then at the bottom of the window press the Clear button:

    a2cb147c-ab2d-4399-9b5d-1fe1bdb0ebfe-image.png

    This will remove the Ctrl+g binding.

  • 1 Votes
    10 Posts
    2k Views
    rodica FR

    Done. If someone wants to make search and replace with Python Script, in a directory:

    # -*- coding: utf-8 -*- from __future__ import print_function from Npp import * import os import sys #------------------------------------------------------------------------------- class T22601(object): def __init__(self): Path="C:\\python-test" for root, dirs, files in os.walk(Path): nested_levels = root.split('/') if len(nested_levels) > 0: del dirs[:] for filename in files: if filename[-5:] == '.html': notepad.open(root + "\\" + filename) console.write(root + "\\" + filename + "\r\n") notepad.runMenuCommand("Encodage", "Convertir en UTF-8") regex_find_repl_dict_list = [ { 'find' : r'foo', 'replace' : r'bar' }, { 'find' : r'bar', 'replace' : r'gaga' }, ] editor.beginUndoAction() for d in regex_find_repl_dict_list: editor.rereplace(d['find'], d['replace']) editor.endUndoAction() notepad.save() notepad.close() #------------------------------------------------------------------------------- if __name__ == '__main__': T22601()
  • Remove excess Scroll From End Line

    3
    0 Votes
    3 Posts
    270 Views
    БоЙсТеНьЮБ

    @alan-kilborn Big thanks :)

  • Get 10 lines before specific word with regular Expression

    7
    0 Votes
    7 Posts
    3k Views
    PeterJonesP

    @mohammed-osama ,

    After you gave up, I made a file containing sixteen copies of:

    twelve eleven ten nine eight seven six five four three two one this line succeeded in being matched

    When I used the regex you quoted, it showed 16 matches, and each match was the line with “succeeded” plus the 10 lines before it:

    bf34c849-f868-49da-b09a-47e61dc9be7b-image.png

    As far as I can tell, that “worked”, based on the problem statement you made in your posts.

    When you say “but not working”, when it works for us, you have to provide more than “not working” in order for us to understand how your requirements differ from those that you’ve stated.

    The “Useful References” I linked were to help you ask your question better. and would be useful to help you ask in a way that we can better understand what you want. The “Please Read Before Posting” gives important information about how to format a post, and links to how to format your text in such a way that we can read it (rather than requiring a moderator go in and fix your posts so that the regex are readable; as a moderator, I was willing to do that twice, because I thought it made your questions more accessible, which would make it more likely that you would get your help). The “Template…” is just that, a template that you can use to easily format your search/replace questions so that you give us both example data and what you have already tried. The last two were additional reading that will help you in the future.

    I went to a lot of effort to make sure you got good help, and yet the extent of your reply was “but not working”. If you try harder, we can continue to try helping. If you give up, then you will never learn how to do what you want. It’s really up to you.

  • TextFX replacement

    5
    1 Votes
    5 Posts
    11k Views
    Josh SchneiderJ

    @alexolog, this works for 64-bit

  • Automated Search & Replace help please

    3
    0 Votes
    3 Posts
    304 Views
    Ramses505R

    @alan-kilborn said in Automated Search & Replace help please:

    s = l.rstrip(‘\n\r’).split(‘#’)

    Hi alan-kilborn, thanks so much for the help. In my simple test, that does solve the problem, appreciated.

    I will now give it a try for real and no doubt realise a few further issues.

    Thanks again.

  • The replacement of the number X with a random number in an interval

    12
    0 Votes
    12 Posts
    3k Views
    David CostacheD

    @peterjones Oh, you are perfectly right. I have begun to run the script with my own python.exe
    It functioned perfectly what @Ekopalypse has told me. Likewise, I have had one more problem, but I have realised what I was doing wrong. When I was saving the script, I was saving it anywhere else other than in *\Notepad++\plugins\PythonScript\scripts and it was not showing up in my PythonScript script menu. I thank the two of you very much.

  • CSVQuery doesn't work with Notepad++ 64 bit?

    3
    0 Votes
    3 Posts
    473 Views
    Terry RT

    @terry-r said in CSVQuery doesn't work with Notepad++ 64 bit?:

    If using the latest version you may be seeing the situation where lots of plugins no longer work, see this announcement.

    A quick search of this forum found this post. So it appears the CSVQuery plugin hasn’t been updated for the latest version of Notepad++. However there appears to be another plugin which may fill the gap. Have a read.

    Terry

  • Python script cursor position

    6
    0 Votes
    6 Posts
    2k Views
    Alan KilbornA

    An additional tip – don’t know how many scripters know this – is to put your caret on an Editor or Notepad function and invoke the context-sensitive help that Peter mentioned.

    So, for example, if you have editor.gotoPos( in your code, and you put your caret somewhere in that text, and run the help, the documentation for that function will open in your default browser:

    d86e2026-3753-49cd-a643-003371c51cc9-image.png

    Invoking the context help can be done on the PythonScript plugin menu (see near the bottom):

    4b3859de-2bc8-499a-b7cd-f4f74d015cd5-image.png

    As shown, I like to assign the Ctrl+F1 shortcut to it; by design it doesn’t have a shortcut key.

  • Change values

    2
    0 Votes
    2 Posts
    295 Views
    PeterJonesP

    @memole1990 ,

    First off, Notepad++ has two plus characters at the end of the name; that differentiates it from the “Microsoft Notepad” app that ships with your OS.

    The algorithm you described (which I would phrase “look for a line which starts with 200 05914 then has a third ‘word’ on the line of an 8 digit number representing the date in yyyymmdd format, then compare that date to March 31, 2022, then delete that line and one other line if the date is after March 31, or keep it if it’s on-or-before that threshold”. (*: For that “one other line”, you give the example of 200 05978, but you don’t tell us exactly the rule for that second line, whether it’s always 3 lines below the 200 05914 line, or whether it always starts with 200 05978 no matter where in the file after the date line, or whether it’s always exactly 200 05978 0000 and nothing else would match and thus be deleted).

    That algorithm includes a numeric comparison (whether it literally compares the yyyymmdd 8digit numbers, or whether it compares the underlying date in some other manner)… but unfortunately for your desire, the Notepad++ search/replace syntax (including the ultra-powerful regular expression syntax) doesn’t do numerical or date comparisons, it is just looking for patterns of strings.

    Thus, your task cannot be reasonable accomplished natively in Notepad++. (I say “reasonably”, because with a complicated enough comparison pattern, you could effectively implement a single numerical comparison in a huge regular expression, but it might not fit within Notepad++ ~2000 character regular expression limit.)

    If I were solving this task for myself, I would just write a program to do it in my favorite interpreted programming language. If I were solving this problem for someone who didn’t know any programming languages, but they were willing to install a plugin for Notepad++, I would have them install the PythonScript plugin, and I would give them a short script that would do pattern matching to find the 200 05914 yyyymmdd line, then do the numeric comparison in the python, then if it passes the deletion rule, delete the two lines. But before coding something up for someone else, I would insist upon a clear definition that got rid of the ambiguities I mentioned earlier.

  • PowerShell Send-MailMessage syntax highlighting

    2
    0 Votes
    2 Posts
    234 Views
    Paul WormerP

    @marcelo-finkielsztein
    From PowerShell Get-Help:

    > [!WARNING] > The `Send-MailMessage` cmdlet is obsolete. This cmdlet does not guarantee secure connections to > SM TP servers. While there is no immediate replacement available in PowerShell, we recommend you do > not use `Send-Ma ilMessage`. For more information, see > Platform Compatibility note DE0005 (https://aka.ms/SendMailMessage).
  • Excel VBA copy to NP++ dword is garbled, vice versa

    4
    0 Votes
    4 Posts
    482 Views
    bwiselyB

    thanks your help for the deltail.
    copy the raw data from exvel VBA or notepad++ copy and paste into excel vba are same problems.

    I will try to via MS notepad to notepad++ to solve this problem.

    thanks

  • Sorting or searching for a language in the style configurator

    4
    0 Votes
    4 Posts
    506 Views
    deleeleeD

    @wanderinformatiker

    I use v8.3.3 32-bits and apart from Global Styles, which is at the top of the list, and Search Results, which is at the bottom of the list, all the languages are in alphabetical order.

  • command line sftp auto-connect

    5
    0 Votes
    5 Posts
    495 Views
    Jimmy DevineJ

    @PeterJones that looks like what I’m looking for. I’ll have to read up on integrating npp user parameters with plugins, thanks!

  • non-saved docs are lost if reopen as administrator

    6
    0 Votes
    6 Posts
    569 Views
    oa klkO

    @PeterJones @Alan-Kilborn
    Thanks for looking into it and thanks for the suggestion.

  • AnalysePlugin stopped working after udpate to 8.3.3

    2
    0 Votes
    2 Posts
    563 Views
    PeterJonesP

    @vladimir-zherdenovsky ,

    I don’t think that AnalysePlugin has released a version of their plugin that’s compatible with the changes made in Notepad++ v8.3.3 – there was a slight change to the interface between plugins and Notepad++ made in v8.3.0; many plugins are having to release a new version to make it compatible, and if a plugin doesn’t have an updated version, many old plugins will not work with v8.3.3.

    It looks like AnalysePlugin created a pre-release 01.13-pre1 a few days after NPP v8.3 was released, so if you download the zipfile at https://sourceforge.net/projects/analyseplugin/files/binaries/v01.13-pre1/ and unzip the DLL overtop your old AnalysePlugin.dll, it might be able to work with NPP v8.3.3 for you.

    Good luck