• Insert code before and after markdown selection

    4
    0 Votes
    4 Posts
    1k Views
    PeterJonesP

    @guy038 ,

    Ah, yeah: I had avoided the S/R in the macro because I didn’t think of ticking the “in selection”. Good idea.

    @fly-wire ,

    My solution is okay; but if you want to preserve your clipboard you should use @guy038’s solution, because mine will replace the contents of the clipboard with your selected text, whereas the search-and-replace macro does not use the clipboard, so your old clipboard contents will still be available for pasting later.

  • NPP menus refreshing causing computer to slow down

    4
    0 Votes
    4 Posts
    446 Views
    orhanodO

    Hi, I encounter this problem on every notepad++ opening. The main menu refreshes 3 times, and each refresh takes around a second. Removing “Explorer” plugin fixed it for me.

  • 0 Votes
    10 Posts
    696 Views
    Polar BearP

    I’ve been able to get the job done, using the suggestions by guy038, which seems the simplest for me.
    (
    SEARCH (?-si)^(.+#0A5D00.+)[/b]

    REPLACE $1

    … )

    Anyhow, thank you both for taking the trouble to help.
    With best wishes

  • 0 Votes
    9 Posts
    1k Views
    Neil SchipperN

    @Polar-Bear

    The cake is fully baked, wonderful scents are coming out of the kitchen, go to other thread here as mentioned by @PeterJones in his post above:

    This conversation was continued in “Deleting a group of characters in lines with same beginning and ending, but different in between (re-post)”.

  • 0 Votes
    2 Posts
    206 Views
    PeterJonesP

    @RC-Ayers ,

    You’ll get more help if you try to describe your problem with a bit more detail.

  • Search title

    3
    0 Votes
    3 Posts
    322 Views
    Christian 0C

    Great!! Thanks! I tried searching in the forum beforehand but I had found nothing.
    Works fine!

  • First F3 ok, F3 again selects the entire doc!!

    5
    0 Votes
    5 Posts
    617 Views
    hcchenH

    @Alan-Kilborn Putting a ^ at the beginning of every regex AND’ed sections has reallllllly fixed the complexity problem! thank you sooooo much!!

  • (Document list + Find + Multiple files + at least 1 file in dual show) bug:

    16
    0 Votes
    16 Posts
    5k Views
    artie-finkelsteinA

    Alternate suggestion (somewhat alluded to by a previous response by Alan Kilborn):

    Don’t move the vertical separator bar so that one of the views is fully obscured, leave at least one text line visible. The obscured pane is only hidden from the user, not from the editor. When a user makes the pane effectively invisible, what they are really doing is saying don’t show me the contents, so when the editor changes the contents (scrolls the file to display the match) the user can’t see what is going on.

    This may not affect the purported bug, but it should at least make it easier to see what is going on. I do note that the Find All in All Opened Documents option will resize the document views to allow space for the Search results window and this may require appropriate resizing of all three panes.

  • I can't open the html on a browser

    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @Danielle-Bray ,

    I’m learning code and it cant open chrome what do I do

    Um. Your question as written does not seem to have anything to do with Notepad++, which is what this forum is about.

    If by this question, you mean, “I have started typing HTML using Notepad++. I would like to view the HTML I am writing in my already-installed Chrome browser on the same computer. How can I do that from Notepad++?”, then the answer is:

    Save the HTML file to some known location Use Notepad++'s View > View Current File In > Chrome, and as long as you have a standard installation of Chrome, the saved file will be opened in Chrome. Now if you make changes in Notepad++, you just need to save there, Alt+Tab over to Chrome and refresh/reload the page (F5 or Ctrl+R).

    On step 2, if you don’t see that menu option, then you might have an ancient Notepad++ version; in that case, a similar command might be available in the Run menu.

  • random replace string for a limited amout of accourenses

    2
    0 Votes
    2 Posts
    403 Views
    PeterJonesP

    @ciucaandrei ,

    Search-and-replace cannot randomize the list of files to search. And search-and-replace doesn’t have a counter that would work exactly like you showed (you can tell it to repeat part of the same regex N times, so it can count to some extent… but that’s counting within a single match, not counting and only doing a replacement for the first N matches). So you would have to manually pick your “random file” and then do the search/replace once in that file; then do that again N times.

    The way you described it, it sounds like a programming challenge, not a text editor feature. And the purpose of this forum is to help each other use the existing features of Notepad++ to the best of its ability, not do other people’s programming for them.

    If you want to solve it in programming, you could type the code to do that in Notepad++, which is one of its primary purposes. And if you wanted to, you could use one of the scripting plugins, like PythonScript, where the script would run on the files that are opened in Notepad++… but even then, it’s still essentially a programming task, and we are not a programming forum.

  • Remove every row with a number less than 1000 up to the first delimiter

    17
    1 Votes
    17 Posts
    5k Views
    guy038G

    Hello @neil-schipper,

    You quoted :

    Color blindness (color vision deficiency, or CVD) affects approximately 1 in 12 men (8%) and 1 in 200 women in the world

    So my proportion of 8.3 % was not correct. Giving your statement, this leads to a real proportion of 50 % × 1 ÷ 12 + 50 % × 1 ÷ 200. So the proportion of color-blind people, among the world population, is rather ≈ 4.4 %, with a clear proportion in men compared to women ( about 16 times more ! )

    BR

    guy038

  • Replacing text from x to y

    13
    0 Votes
    13 Posts
    1k Views
    Neil SchipperN

    @guy038 said in Replacing text from x to y:

    So the correct regex

    Confirmed. In hindsight I should’ve spotted it myself – every instance of backslash-leftbracket on this site should be treat with suspicion and caution.

  • How to Remove a Column when Rows are Uneven

    7
    0 Votes
    7 Posts
    900 Views
    guy038G

    Hello, @ryan-mclaughlin, @peterjones and All,

    We must take care whether the ranges between "........." may or not contain comma(s), themselves !

    if we consider the general case, where :

    The field separator is the comma character

    Some fields are surrounded by doubles quotes, containing possible commas or could be empty fields ( "")

    Some fields do not contain any double-quote and could be empty too

    The field to delete is the last field of each row, possibly followed with a comma

    Then, the following regex S/R is the right solution, especially when the total number of fields of a row is inferior to the number of the field to delete !!

    SEARCH (?-s)^(?:"[^"\r\n]*",|[^",\r\n]*,){N}\K(?:"[^"\r\n]*",?|[^",\r\n]*,?)    where N is the number of fields right before the field to delete

    REPLACE Leave EMPTY

    Tick preferably the Wrap around option

    Click only on the Replace All button

    Test it against this two-lines text :

    "ClientNumber","","First,Name",123456789,"Last,Name",2021-12-31,"Gender","","Email","AddressLine1",,"1,234.56","PhoneNo","ApprovedDate",01-34-56-78,Field to delete,"ClientDischargeDate","Case Manager(EMPID)", "ClientNumber","","First,Name",123456789,"Last,Name",2021-12-31,"Gender","","Email","AddressLine1",,"1,234.56","PhoneNo","ApprovedDate",01-34-56-78,Last field to delete,

    Note that field 12 ( "1,234.56" ) contains a decimal number with a comma separator => I surrounded this field with double-quotes to keep its meaning

    Best Regards,

    guy038

  • Regular expression size limited 2048 chars How to make it longer?

    14
    0 Votes
    14 Posts
    6k Views
    Alan KilbornA

    @hcchen said in Regular expression size limited 2048 chars How to make it longer?:

    After all, I pop up a message box that informs user that the RegEx will be copy to clipboard, OK or Cancel? that’s all. Users can easily use the ‘Find’ dialog then

    That’s a nice approach to solving your problem.
    Sometimes it just takes some discussion and background thinking to get to the right conclusion.

  • Is this possible, suffix text based on a list.

    16
    0 Votes
    16 Posts
    911 Views
    Mark LittlefairM

    @PeterJones

    That’s run through great now, thank you. :)

    Capture2.JPG

  • The Style Token not working propierly

    4
    0 Votes
    4 Posts
    1k Views
    Alan KilbornA

    @Ariel-Eduardo-Gonzalez

    Try to read the release notes when you upgrade to a new version, to get a feeling for new features and settings that have been added – it could save you time as you wouldn’t need to ask and could get back to being productive right away.

  • special search and replace in Notepad++

    5
    0 Votes
    5 Posts
    641 Views
    Thomas KlinghanT

    @Alan-Kilborn
    Hello Alan Kilborn,
    Thanks for your tips.

    Best regards
    Thomas

  • Deleting lines that repeat the first 15 characters

    25
    0 Votes
    25 Posts
    15k Views
    PeterJonesP

    @Saya-Jujur ,

    Untested, because I am on my phone, but maybe try

    prev = '' with open('data.txt') as f: for (n, line) in enumerate(f): if line[:200] == prev[:200]: print n+1 prev = line[:200]

    (You said you changed to 200 already, but maybe you missed an instance, or maybe comparing just the left of prev is enough)

    If that doesn’t work, then follow @Terry-R’s advice

  • Remove rows that contain 1-999 from the first 3 numbers of the row.

    10
    0 Votes
    10 Posts
    2k Views
    Terry RT

    OP has continued this (albeit with some changes in request) in this post.

    Terry

  • Regen: To replace XML elements

    12
    0 Votes
    12 Posts
    833 Views
    Wan Lung HoW

    Hi @guy038 , I really appreciate your help. Not only resolved my problem, but also taught me something with your detailed explanation.