• add text in multiple files

    3
    2 Votes
    3 Posts
    457 Views
    Stefano SchiaviniS

    thank you,

    exactly what I needed.
    works great.

    Stefano

  • Encapsulating specific lines with angle brackets

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @guy038 ,

    I agree with your interpretation. I just didn’t see enough in my first reading to get that far.

    Because the original post didn’t show a “before” and “after” state, I missed the “every line that starts with @” portion. Since I didn’t see enough information, I gave a brief reply that introduced the concepts required, and linked to the appropriate reading for those concepts.

    But yes, doing it my way with the “every line that starts with @”, I would change my FIND to (?-s)^@(.*)$ and the full replacement would be <$1>.

    For @Elnaz-Kia ,

    The substitution escape sequences section of the same usermanual page briefly describes @guy038’s $0 notation and my $1 is described in the section on $ℕ in the document. Both are essentially equivalent, with @guy038 making use of the automatic “whole match” capture group and mine using an explicit capture group.

  • Sign not showable?

    3
    0 Votes
    3 Posts
    170 Views
    BlackMage2B

    Many thanks! That helped. :D

  • Chapter Headings

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @Dave-Clark ,

    A text file knows nothing about chapters, headers, or the like. It is a series of bytes which are all interpreted as text (hence the name “text file”).

    I don’t know about the Kindle formats in particular, but when I’ve looked into open-source EPUB format, it is basically a zipped collection of HTML and associated images.

    So maybe if you wrote your text file as HTML, using HTML syntax for headings (<h1>, <h2>, …), that would give you what you need.

    But none of this is really on-topic here, because the answer would be the same whether you use Notepad++ (which you should), or Windows notepad.exe (shudder), or copy con textfile.txt () to edit your file.

  • 0 Votes
    2 Posts
    253 Views
    EkopalypseE

    @stmav
    Sorry, but this is hardly possible with the built-in UDL since parts
    are dynamic and UDL does not provide regex terms to identify different parts.
    You have to write your own lexer for this case.
    A scripting plugin like PythonScript can be used to make this possible.
    If you are familiar with another programming language there may be ways to use it as well.

  • 0 Votes
    6 Posts
    418 Views
    guy038G

    Hello, @robin-cruise and All,

    In the search regex (?s)(https://xxx.com/en/)([^"]+)".+?\1(?!\2").+?" :

    The regex part https://xxx.com/en/ looks for the literal string https://xxx.com/en/, stored as group 1

    The regex part ([^"]+)" represents the remainder of the internet address ( for instance the string page-AAA.html ), followed with a double-quote, because [^"]+ is a non-null range of consecutive chars, all different from ", stored as group 2

    Now, the part .+? stands for the shortest range of any char till…

    The group 1 ( \1 ). So an other string https://xxx.com/en/

    Which must be followed by .+?", which represents the shortest non-null range of any char before a double-quote

    But ONLY IF this range is different from \2 ( i.e. different, for instance, from the string page-AAA.html and a " char )

    Note also that the [^"]+" syntax, without the parentheses, is more restrictive than .+?" and must be preferred because of the negative look-ahead (?!\2")

    Besst Regards,

    guy038

  • Please need a multiple renewable change

    5
    0 Votes
    5 Posts
    405 Views
    guy038G

    Hello, @patrick-rozon , @peterjones , @terry-r and All,

    Here is my solution. Not ideal, of course, as it would be suitable for small file size, only, but quite flexible !. It also uses a dummy character, not present in current file. I presonally chose the ¤ char of my French keyboard but, of course, any other char may be used

    Add a line ¤123456 at the very end of current file

    SEARCH (?s)&(.*¤)(\d)(\d+)|¤\d+

    REPLACE ?1\2\1\3\2

    Tick the Wrap around option

    Select the Regular expression seardh mode

    Hit, repeatedly, on Alt + R ( Replace button ) OR on Alt + A ( Replace All button ) till one of the follwing messages occurs :

    Replace: one occurrence was replaced. No more occurrences were found.

    Replae All: 0 occurrences were replaced in entire file

    One advantage of this method is that you may change, either, the modudlo and the values, without changing the regex S/R ! For instance, let’s suppose you want to replace any & char, by any even number ( so, modulo 5 ), in decreasing order, Then, simply add the line ¤86420 at the very end of the file and just use the regex S/R mentionned above !

    So, from the INPUT text :

    ------------&--------------&----&&-----------------&----------------&----- ------------&--------------&----&&-----------------&----------------&----- ------------&--------------&----&&-----------------&----------------&----- ¤86420

    After 19 replaceemnts, we would get the OUTPUT text :

    ------------8--------------6----42-----------------0----------------8----- ------------6--------------4----20-----------------8----------------6----- ------------4--------------2----08-----------------6----------------4-----

    Best Regards,

    guy038

  • How do you update AppData configs like contextMenu.xml?

    8
    1 Votes
    8 Posts
    2k Views
    EkopalypseE

    …, I suggested to only save the changes that are different from the default file to the users file.

    but that means it has to have its own name, otherwise it won’t
    work with portable versions where EVERYTHING has to be under a root directory.

  • How to properly display French characters in HTML?

    7
    0 Votes
    7 Posts
    5k Views
    Pour SvdeuxP

    @Alan-Kilborn
    Got it, thanks!

  • Extract from a list

    2
    0 Votes
    2 Posts
    247 Views
    PeterJonesP

    @Pedro-Contreras ,

    Assuming your post converted ASCII quotes to smartquotes because you didn’t use the </> button in the forum, then an answer that works for the data you presented is to use regular expression mode with FIND = (?-s)^([^,\r\n]*?,){2}'([^,\r\n]*?)',(?1){4}'([^,\r\n]*?)',.*$ and REPLACE = $2 $3

    (2X0997,'navx8n','nap345','','','Nava','A','firstname@yahoo.com','no 2Z,n street,saras ng,selaiyur','','chennai','TN ','IN','0000X3','0000-00-00')

    becomes

    nap345 firstname@yahoo.com

    ----

    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.

  • Notepad++ How to find in page with UTF-8 instead of ANSI ?

    3
    0 Votes
    3 Posts
    263 Views
    Robin CruiseR

    yes, nice answer. But very hard , because I need to change almost all words from every sentence:)

  • How do I replace only the first <br> tag across multiple files?

    25
    0 Votes
    25 Posts
    2k Views
    guy038G

    Hi, @scott-nielson and All,

    A bit off-topic : Yeah, it’s a common mistake when doing translations ! In French, this kind of words are known as “faux amis” words ! Just because :

    In English, the adjective sensible have the French sense of raisonnable / sensé or pratique

    In French the adjective sensible have the English sense of sensitive or noticable

    So, I should have used the expression sensitive to case !

    Cheers,

    guy038

  • F7 does not work

    6
    0 Votes
    6 Posts
    2k Views
    УменяМодем ОграниченныйТрафикУ

    I tried it now - the function works!
    Now it doesn’t work again - there is nothing in the window again!
    And the function did not find a match!
    I did everything as you say here!2021-08-07_13-29-31.png

  • Can Some Help Me?

    5
    0 Votes
    5 Posts
    214 Views
    GregG

    Hi Peter,

    I figured out what you were trying to tell me and YES I was able to find the missing files.

    Thank you for your assistance. Very much appreciated.

    Greg Shaw

  • I want to mark lines that do NOT contain a certain character

    3
    0 Votes
    3 Posts
    264 Views
    Chris Tanguay 0C

    @Alan-Kilborn Thank you. That works prefectly!

  • the file is unreadable

    2
    0 Votes
    2 Posts
    631 Views
    Alan KilbornA

    @Чёрный-Хомячок

    It looks like you have a binary file, and you should not edit that with Notepad++ (a text editor, not a binary editor).

    You should edit such a file with a “hex editor”, but in your case since you don’t know already these things it is probably ill-advised for you to edit it at all.

  • Synchronized Vertical Scrolling is grayed out.

    2
    0 Votes
    2 Posts
    225 Views
    PeterJonesP

    @Luis-Piña-III ,

    Do you have two views visible?

  • Replace some text of a string in multiple lines

    2
    0 Votes
    2 Posts
    145 Views
    Alan KilbornA

    @Sheraz-Ahmed

    So…what makes the example BISM different from the other occurrences of BISM? This would be critical to know in order to offer advice to you.

  • Show no-break space

    7
    1 Votes
    7 Posts
    38k Views
    Alan KilbornA

    For those interested, there’s a PythonScript way of doing this sort of thing, HERE.

  • Replace lowercase with uppercase between brackets

    11
    1 Votes
    11 Posts
    3k Views
    Hank KH

    NP …Thanks again Terry … Cheers