• TAB OUT OF CONTROL

    4
    0 Votes
    4 Posts
    426 Views
    Alan KilbornA

    @Garry-Petrie said in TAB OUT OF CONTROL:

    All I wanted to do is use word wrap and intent the first line with a tab character, you know, like normal writing and typing. Once tab is invoked, it repeats on every subsequent line. BAD, BAD, BAD.

    Couldn’t you not whine, and just ask a civilized question, like “How do I do this?”

    You obtained this:

    f6eed6f6-fec9-4549-8425-232fc62e3a2f-image.png

    And to get what you wanted all you had to do was select this:

    314072dc-ba95-43fd-9810-c034cd172ca3-image.png

    But you’re long gone now, back to Notepad.exe.
    Lucky you.

  • Erase content from duplicate lines, but keeping the first unchanged

    9
    2 Votes
    9 Posts
    444 Views
    guy038G

    Hello, @luís-gonçalves, @mark-olson, @alan-kilborn, @peterjones and All,

    Here is a quick way to mark all consecutive equal lines but the first !

    First, add a final line-break at the end of your number’s list ! ( IMPORTANT )

    MARK (?x) ^ ( \d+ \R ) \K ( \1 )+

    Bookmark line, Purge for each search and Regular expression checked

    Then, you can follow the @mark-olson’s instructions ! So :

    Put a single space char in the clipboard with Ctrl + C

    Run the Search > Bookmark > Paste to (Replace) Boomarked Lines option

    Finally, run the simple S/R :

    SEARCH ^\x20$

    REPLACE Leave EMPTY

    Or use the Edit > Blank Operations > Trim Trailing Space option

    Best Regards

    guy038

  • Custom Toolbar Icon - Custom Date Time Stamp: Mini-Tutorial

    12
    2 Votes
    12 Posts
    858 Views
    PeterJonesP

    @glimmerwell said in Custom Toolbar Icon - Custom Date Time Stamp: Mini-Tutorial:

    That is how I extracted the icon. But I am not using the Fluent toolbar. I just personally like the standard icons better.

    Then you have to use a bitmap.

    I still would like a bitmap version of the clock icon

    Microsoft Windows still comes with an application called mspaint.exe, even though it’s not their default for image editing anymore. You can open that application (WindowsKey + R => mspaint.exe, et voila, it appears), load the .ico file, and Save As a .bmp. Or you can find one of a plethora of app-based or online-based image converters which could convert the icon from .ico to .bmp for you.

  • "Invalid regular expression" error after crossing line ~3000000

    5
    0 Votes
    5 Posts
    705 Views
    PeterJonesP

    @Bahaa-Eddin-ツ said in “Invalid regular expression” error after crossing line ~3000000:

    Can you explain the thing you didn’t understand so I can edit the post

    His point was, because you didn’t use ` before and after your regex (to put it in a red typeface), the asterisk wildcards in your regex became italics in your post. It makes it very hard to know what regex you tried when you don’t even look at the “preview” or the post after you’ve hit SUBMIT, and notice that the regex that’s shown isn’t the regex that you tried.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • Wrong manipulation help

    3
    0 Votes
    3 Posts
    223 Views
    Clément BerguerandC

    @PeterJones said in Wrong manipulation help:

    @Clément-Berguerand ,
    By default, Notepad++ enables the Settings > Preferences > Backup option for session-snapshot-periodic-backup, which only keeps a temporary backup copy to keep unsaved changes, it’s not a true “backup”, and it goes away when you hit SAVE or CLOSE in Notepad++
    Notepad++ has an additional feature “backup on save” available in the same Preferences dialog, which will create filename.bak or similar every time you hit SAVE. But if you didn’t already have that option enabled, it won’t help you now, and there’s nothing that Notepad++ can do for you. If you did already have that option enabled, there should be a .bak file next to your saved game, or in the “custom backup directory” listed in the Preferences dialog. (Notepad++ doesn’t enable that option by default because when the developer tried, a plethora of users complained about too many .bak files being created that they didn’t want. I argued in favor of data safety, but don’t-create-.bak-files-by-default crowd won that argument.)
    For future data safety, I highly recommend reading our backup features and autosave plugin FAQ, and set things up to make it less likely that you will lose your data.
    If your data is lost, that FAQ does mention a potential piece of software (not officially recommended or endorsed, other than some users have had luck with that tool) that can help recover deleted files.
    Good luck.

    Thank you very much. I’ll try to do it.

  • How Np++ handles char count?

    8
    0 Votes
    8 Posts
    2k Views
    pintassilgoP

    Thanks for all the replies. Byte count looks good enough for me, there is already a dedicated plugin to more refined statistics like count chars and words, for statusbar I believe byte count is enough.

    However, the other editor I’m talking about (CudaText) doesn’t use Scintilla, it has its own editing component (ATSynEdit) that doesn’t use simple buffer storage to retrieve byte count, it has “list of lines” according to the dev so the count would be slow.

    An optimization is possible by caching the size of each line, adding them up and then updating with edit events (typing one char sums 1…). But at the moment he don’t plan to work on it because it’s not that trivial as the editor supports multiple carets, multiple selections ans so on.

    Just adding, other text editor I have installed here, Kate, displays not only chars count (precisely, not bytes) but also count of words in statusbar. However these counts aren’t instant, I can see they wait for like half a second without change in the text to update. Clearly it’s done this way because it’s not that cheap to be done instantly.

  • add characters

    4
    0 Votes
    4 Posts
    488 Views
    Mr SchnokM

    Hello @guy038

    Thank you very much. It works very well.
    And especially thank you for the explanation.

    Have a nice day.
    Phil

  • Installation does not wait for completion

    1
    0 Votes
    1 Posts
    129 Views
    No one has replied
  • How can i bulk change this

    5
    0 Votes
    5 Posts
    581 Views
    Michael VvM

    @PeterJones thanks man, you helped me a lot!

  • Replace html tag with regular expression

    2
    1 Votes
    2 Posts
    918 Views
    PeterJonesP

    @Linh-Việt ,

    So, you want to replace any <article-title> with <chapter-title>, but only when inside a <type="book"> .... </type> pair, and not between other types, like <type="journal">...</type>?

    That sounds like a job for FAQs > Generic Regex > Replacing in a specific zone of text , where you could use:

    Find Regex FR = article-title> Replacement Regex RR = chapter-title> Begin Search Region BSR = <type="book"> End Search Region ESR = </type>

    Using those values in the bold “variables” in the regex shown in that article, you would get:

    Find What = (?-si:<type="book">|(?!\A)\G)(?s-i:(?!</type>).)*?\K(?-si:article-title>) Replace With = chapter-title> Replace All will convert the text for you. (doing multiple Replace commands won’t necessarily work, because of the way that \K works)

    BTW: thanks for formatting your example data correctly. It helps us make sure we read your data correctly!

    ----

    Useful References Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • Plugin admin and compare plugin removed after update notepad++

    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @Subhash-Sheladia ,

    You updated to a version that’s 1.5 years old? /me shudders to think how old your from version was.

    If you see a bug like Plugins Admin missing, a good idea is to try updating to the newest version (v8.5, released over the weekend) and see if the problem is fixed. If downloading the newest doesn’t work, please give us a recursive directory listing for c:\Program Files\Notepad++\ (using dir /s "c:\Program Files\Notepad++\" from a command prompt).

    But if you were really updating from a version that old, then the old Compare plugin you used to have would not be compatible with the modern Notepad++, so v8.1.1 may have disabled it. If you can successfully install v8.5 and see Plugins Admin again, then you will see that Plugins Admin lists both Compare 2.0.2 and ComparePlus 1.1 – ComparePlus is the replacement for Compare, and will work better on modern Notepad++ going forward, so I highly recommend installing that.

  • Data parser/import?

    24
    0 Votes
    24 Posts
    3k Views
    V.MelnikV

    @guy038
    Thank you again @guy038
    But I decided this at the stage of preparation of the “B” file, by replacing it

    . </p>

    on

    </p>
  • Python: Multiple files ANSI to utf-8 converter

    9
    0 Votes
    9 Posts
    4k Views
    PeterJonesP

    @Mark-Olson ,

    Note that this doesn’t use Notepad++ for anything,

    I appreciate your willingness to help. However, we need to focus this Forum on Notepad++. If it’s something that can be done in PythonScript, and you are interested in providing the solution, please make it compatible with PythonScript. This forum isn’t for “generic” Python code-writing.

  • How can I replace all lines with given text?

    3
    0 Votes
    3 Posts
    448 Views
    PeterJonesP

    @Luis-Piña-III

    To replace an entire line, you will want to combine the regex concepts for “anchor to beginning of line” with “match 0 or more of any character” then “anchor to end of line”. The Online User Manual Searching/Regex section linked below will help you quickly find those concepts" (search for “anchor” and “any character” and “0 or more”)

    The replacement is just the text you want it to be replaced with.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • Help replacing a portion of a word

    4
    0 Votes
    4 Posts
    252 Views
    Vince LandryV

    @Mark-Olson Thank you so much!

  • Are seperate installation files for the Compare plugin?

    3
    0 Votes
    3 Posts
    232 Views
    Kathi WK

    @Michael-Vincent Thank you I will go there!

  • Minimize notepad++ to tray instead of closing.

    26
    0 Votes
    26 Posts
    8k Views
    Alan KilbornA

    @PeterJones said in Minimize notepad++ to tray instead of closing.:

    They just fixed it. I wonder what prompted them to notice and fix that issue.

    I think a developer was working on a batch of translating issues, and just gathered that one into the batch.

  • EML as supported file language style

    1
    0 Votes
    1 Posts
    814 Views
    No one has replied
  • Tabs to spaces

    6
    0 Votes
    6 Posts
    33k Views
    guy038G

    Hello, @the-fartman and All,

    I realize that I made some syntax errors in the last part of my last and very old post ( After the P.S. indication )

    So, here is the updated version :

    P.S. :

    Here is, below, a mRNA sequence, translated into proteins, by a ribosome of a living cell ( found somewhere, in a regex documentation, to explain the interest of the \G regex feature ! ) :

    ....AUGGGUCGACUGGUUCUCGAAGGUUUCAAAGGUUCAAGGGUCCGGUAUUCAGUCGUCCGCUCUACUGGUACAAAGGGGGUACCACGACUGGUUCUCGAAUAG

    If we take off the start codon AUG and its leading nearby sequences, as well as the stop codon UAG, we, now, obtain the sequence :

    GGUCGACUGGUUCUCGAAGGUUUCAAAGGUUCAAGGGUCCGGUAUUCAGUCGUCCGCUCUACUGGUACAAAGGGGGUACCACGACUGGUUCUCGAA ¯¯¯ ¨¨¨ ¯¯¯ ¯¯¯ ¨¨¨ ¨¨¨ ¯¯¯ ¨¨¨ ¨¨¨ 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

    In that RNA sequence, let’s consider the amino-acid sequence GGU. You remark, easily, that :

    At positions 1, 19, 28 and 64, this sequence is a TRUE codon

    At positions 9, 36, 41, 75 and 87, this sequence is NOT a codon

    Now :

    Place the cursor right before the RNA sequence GGUCGA… ( IMPORTANT)

    To understand the effect of the \G feature, try, successively, the 3 regexes, below :

    .*?GGU which matches the SHORTEST range of characters, till an amino-acid sequence GGU (\u\u\u)*?GGU which matches the SHORTEST range of TRIPLETS, till an amino-acid sequence GGU \G(\u\u\u)*?GGU which matches the SHORTEST range of CODONS, till a GGU codon

    Notes :

    The first regex matches any range of capital letters, whatever its size, followed with the first string GGU

    The second regex matches any range, containing 3*n capital letters, followed with the first string GGU ( n >= 0 )

    The third regex matches any range, containing 3*n capital letters, followed with the first string GGU, separated, from the beginning, by 3*m capital letters, so the GGU sequence is a codon ( n and m >= 0 )

    Similarly, try these 3 regexes below :

    .*GGU which matches the LONGEST range of characters, till an amino-acid sequence GGU (\u\u\u)*GGU which matches the LONGEST range of TRIPLETS, till an amino-acid sequence GGU \G(\u\u\u)*GGU which matches the LONGEST range of CODONS, till a GGU codon

    Notes :

    The first regex matches any range of capital letters, whatever its size, followed with the last string GGU

    The second regex matches any range, containing 3*n capital letters, followed with a last string GGU ( n >= 0 )

    The third regex matches any range, containing 3*n capital letters, followed with the last string GGU, separated, from the beginning, by 3*m capital letters, so the GGU sequence is a codon ( n and m >= 0 )

    For further information, on that topic, refer to the links, below :

    https://en.wikipedia.org/wiki/Codon

    https://en.wikipedia.org/wiki/Start_codon

    https://en.wikipedia.org/wiki/Stop_codon

  • Ownership Model for pointer data?

    20
    0 Votes
    20 Posts
    917 Views
    xzaton jwX

    @Lycan-Thrope

    There may genuinely be some confusion, let me clarify, when I talk about ownership semantics, I specifically mean:

    Who is responsible for “cleaning up” any resource which must be “freed” after it has been “acquired”?

    Its part of all languages, whether is a GC, or done manually. It could be dynamic memory, or some I/O like a file or network port. All this stuff about it being related to OOP is nonsense, but I can see why you thought that because RAII is an excellent way to handle it.

    As an example, look here: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessage

    Literally an example of passing ownership of a buffer in the win32 API.

    And listen man, programming is hard and asking questions is ok because it gives people a chance to learn something new.

    Maybe you should save your comments about working everything out on your own for places other than a forum?

    And while im here, everytime you’ve used stackoverflow, you’re being a hypocrite, because if it isn’t you asking for help, it’s you benefitting from someone else asking.