• 0 Votes
    2 Posts
    466 Views
    PeterJonesP

    @Ryad-Arlan ,

    Search/replace (regex) does not know how to count. So it cannot increment your replacement, and it cannot count how many replacements it has done.

    To do that, you need a programming language. If you use a plugin like PythonScript, you can leverage the full power of the Python language and give it the access to the contents of the Notepad++ editor window. If you’re willing to go that route, you can search the forum for add_1 and find a lot of examples for the “add_1” style of pythonscript search-and-increment-replace. For stopping after 20 instances, you can look at the optional final argument of the editor.rereplace(search, replace[, flags[, startPosition[, endPosition[, maxCount]]]]) method.

    if you have trouble customizing what you’ve seen elsewhere for your specific situation, show us what you’ve tried, and we might be able to point out where it’s gone wrong.

  • 0 Votes
    4 Posts
    395 Views
    PeterJonesP

    @Clayton-Lewis said in Need numbers going up on every blank line followed by a previous line break for subtitles:

    except for step 3 part 2-4.

    You are right. After 3.4, I should have said another Begin/End Selection. Sorry. But yes, what you described is equivalent.

  • 0 Votes
    6 Posts
    2k Views
    PeterJonesP

    @Bader-Alharbi said in I want to compare two files and bookmark the lines containing similar words:

    is there a regex to add the line number in multiple places in the line?

    Regular expressions cannot count (they have no concept of “increment a number”). Your two options inside Notepad++ are using the Column Editor like you’ve already discovered, or using a scripting plugin like PythonScript and using the full power of a programming language to influence the text in the open file. (I actually just answered a question earlier today on that same concept.)

    apply it to different files with a different number of lines.

    as linked in that other topic (and the links refenced there), you can make a macro that will do the begin/end-select for column mode… and if you combined that with other controls, like the Ctrl+Home to go to the start of the file, and Ctrl+End to go to the end, you could have a macro that does the zeroeth-column select in the macro, then manually type Alt+C to bring up the column editor and insert the numbers, then you could use another regex (using multiple capture groups) to distribute the number from the beginning of the line to the various locations throughout the line that you need

  • Regex: Search and Replace in Chess PGN

    7
    0 Votes
    7 Posts
    578 Views
    jhone vickJ

    @Nguyen-Wanderoz Hey,
    i jus Wanna Need Your Help I am Having Some issue In My Project When I press Shift Button Mt [SpaceBar stop Responding.
    I Need [Help]

  • Visibility of EOL

    7
    0 Votes
    7 Posts
    820 Views
    astrosofistaA

    @Alan-Kilborn said in Visibility of EOL:

    I believe that a newer Scintilla editing component than N++ (8.1.4) currently uses is available which makes the effect less pronounced, but this newer component would have to be integrated into N++ in order to work.

    That is correct. For the curious among you, the new feature was introduced in Scintilla 5.1.0. See here for details.

  • .msi installer

    2
    0 Votes
    2 Posts
    972 Views
    Alan KilbornA

    @Muhammad-Farhan

    There is no .msi installer.
    Your download options are on the download site: https://notepad-plus-plus.org/downloads/v8.1.4/

  • Can't figure out a proper way to make this custom UDL work

    3
    0 Votes
    3 Posts
    360 Views
    TBlazeWarriorTT

    @PeterJones Thanks a lot for the clarification. I think the proposed solution is a bit too complex for me (and the operators didn’t cause me issues), and you’ve sadly confirmed that most bugs I’m experiencing are unfixable, so I might leave it the language as it is.
    It is a bit of a pity that it is like this, but it’s not too bad and at least now I know it’s not my fault, so thanks again

  • Splitting to multiple files

    8
    0 Votes
    8 Posts
    5k Views
    Terry RT

    @Alan-Kilborn said in Splitting to multiple files:

    Did you have something in mind that was more sophisticated than that (but still a poor approach compared to non-N++ solutions)?

    Nope, just the same as you. it would require effort in setting up the PythonScript (or other program lang.), or regex to do the job. then if OP wasn’t happy with result, having to change the process to accommodate. The non-N++ solutions have all those options baked in, so far easier.

    Also the number of lines the OP stated makes me wary that a buffer overload may occur as well.

    Terry

  • Linking html to css

    5
    0 Votes
    5 Posts
    1k Views
    PeterJonesP

    For future readers, don’t have the same misunderstanding as was expressed above: we help Notepad++ users to use Notepad++. We are quite happy to do so. I personally tackle many Notepad++-related problems in this forum nearly every day. Just look at the recent posting history for factual proof of this.

    What we cannot be is the entirety of stack exchange: we do not have experts on every possible programming language and every possible markup language and every possible cookie recipe.

    Just because you use a particular text editor to type your source code doesn’t mean that the forum for that text editor should be expected to answer any programming questions you have.

    If you have a C-programming question, go to a forum that specializes in C. If you have an HTML+CSS+JavaScript question, go to a forum about web authoring. If you have a question about cookie recipes, go to a cooking or baking forum. If you have questions about how to sort the text in your text file that you’re editing with Notepad++, this is the right place for you.

    But going back to @Munawar-Ali’s question: it was said, “still it just shows the html on browser” – that might be interpreted as “it is showing the raw HTML markup rather than the rendered webpage”. If that’s the case, then you can use Notepad++ to save the file as HTML and give it a .html extension. And when you are using Notepad++ to type your HTML and CSS files, you can have your saved HTML file in the active tab in Notepad++ and run View > View Current File in… to pick your favorite browser, and Notepad++ will issue the command for that browser to open the active file in the browser; if it’s properly saved as HTML, and the browser will render that HTML file as a local webpage; if the HTML is written correctly (with all the files in the right place relative to each other), then it will render correctly in the chosen browser.

  • Image links

    2
    0 Votes
    2 Posts
    640 Views
    Alan KilbornA

    @Angela-Madera

    I’m sure someone can, but not here.
    This area is for discussion about Notepad++ the text editor, not “images on a website”.

    Please find an appropriate forum for your question – thanks.

  • Page-down scrolls everything off the top of the window

    4
    0 Votes
    4 Posts
    966 Views
    StephanKolassaS

    @Michael-Vincent Thanks for that fast reply! That did the trick!

  • menu - entry: (german) Zeilenumbruch

    2
    0 Votes
    2 Posts
    583 Views
    PeterJonesP

    @Andree-Henkel ,

    [translated to English] Menu Entry: (german) Word Wrap (or maybe Line Break)

    What about the Word Wrap menu entry in German?

  • Desapareció la opción Arriba en la Ventana Abrir Archivos

    2
    0 Votes
    2 Posts
    359 Views
    PeterJonesP

    @Carlos-Figueroa-Arteaga ,

    Again, I will not here that Notepad++ is a Windows application, and the developers only support Windows environments; if you can make it work in Wine (which is what PlayOnLinux uses under the hood), great for you! But that’s not a supported use case.

    2 Notepad updates prior to v8.1.4 (32-bit) on Ubuntu 18 with PlayOnLinux disappeared the option to go Up to upper folders. This is very uncomfortable. Please put it back. Thanks.

    The Notepad++ Open File dialog does allow going up directories, in the same way it always has. If Wine/PlayOnLinux do not support the standard windows API calls that Notepad++ uses to get the OpenFIle dialog working, then the problem is with Wine/PlayOnLinux, not with Notepad++.

    Sorry.

  • Bug en Ventana Buscar v8.1.4 (32-bit) en PlayOnLinux

    2
    0 Votes
    2 Posts
    205 Views
    PeterJonesP

    @Carlos-Figueroa-Arteaga ,

    Sorry, based on the google translation of your problem, I am not sure what is wrong with the Search window for you. For me, on Windows 10, the search engine works just fine on Notepad++ v8.1.4.

    It should be noted that Notepad++ is a Windows application, and the developers only support Windows environments; if you can make it work in Wine (which is what PlayOnLinux uses under the hood), great for you! But that’s not a supported use case.

  • Moving text into a file

    8
    0 Votes
    8 Posts
    1k Views
    Gasser AndréG

    @Hi Terry

    Thanks a lot for your clear and precise explanation. It works fine.

    Best regards and again many thanks for your help
    André

  • Add single quote and comma

    2
    0 Votes
    2 Posts
    16k Views
    Terry RT

    @chin-pat said in Add single quote and comma:

    How can I add single quote and comma for each of the sequence no and also how can I get this on a column like this

    To get this:
    ‘12345’, ‘56789’, ‘23456’, ‘56789’, ‘56789’
    use the following regular expression in the Replace function (search mode is regular expression). Note the single quote isn’t what you show in the post, verify I have the correct one as the posting engine does change quotes when not inside the black boxes (se the </> icon to encapsulate examples)
    Find What:\d+(?=(\x20)|$)
    Replace With:'$0'(?1,)

    To get this
    12345
    56789
    23456
    56789
    56789
    use the following regular expression
    Find What:\x20
    Replace With:\r\n

    Terry

  • How to make comments in code stand out

    2
    0 Votes
    2 Posts
    729 Views
    Alan KilbornA

    @Cyndi-Roether

    The key is to make your file a Python file and then things (comments included) will “stand out”, example:

    e0a23532-387e-46ae-b5fa-64cd45bf26b3-image.png

    See where it says “Python file” on the status bar?

    You can make this appear by saving your file with a name that ends in .py, or by choosing “Python” on the Language menu.

    Also, a Python comment involves no “bracketing”. A # appearing on a line will cause anything following that character (and still on that same line) to be a comment.

  • Run C++ within notepad++

    12
    0 Votes
    12 Posts
    15k Views
    PeterJonesP

    @william-busigo ,

    This discussion was relying on the fact that everyone involved had the NppExec plugin installed. Everything that has been said in this discussion assumed that as a given.

    I think before asking any more questions, you need to read and understand our FAQ on “how do I use Notepad++ to compile my source code”.

  • Plugin Admin bug

    2
    2 Votes
    2 Posts
    184 Views
    Michael VincentM

    @Michael-Vincent

    See https://community.notepad-plus-plus.org/topic/21853/notepad-8-1-5-rc2/3

    Using the RC thread first before opening a Notepad++ issue. I narrowed down to the particular commit which does change the pluginsAdmin.cpp file.

    Cheers.

  • Add some number like :1234 after the Name

    3
    0 Votes
    3 Posts
    292 Views
    PeterJonesP

    @Joseph-Gaitan ,

    FIND = Name
    REPLACE = Name:1234

    I’m sure that’s not what you actually wanted, but it’s the best guess possible given the limited information in your post. To get a better answer, you are going to have to supply example data, using the tools in the toolbar and the preview window to make sure you’re accurately communicating your data to us. Really, I suggest reading and understanding the generic help info below before responding.

    ----

    Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as literal text using the </> toolbar button or manual Markdown syntax. To make regex in red (and so they keep their special characters like *), use backticks, like `^.*?blah.*?\z`. Screenshots can be pasted from the clipboard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get. Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.