• Login
Community
  • Login
  1. Home
  2. Help wanted · · · – – – · · ·
Log in to post
Load new posts
  • Recently Replied
  • Recently Created
  • Most Posts
  • Most Votes
  • Most Views
  • D

    Find repeating lines in a line?

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Nov 16, 2022, 6:26 PM
    Nov 16, 2022, 4:23 PM
    0 Votes
    3 Posts
    388 Views
    N Nov 16, 2022, 6:26 PM

    @Digi-Uzman

    When you say extract, what exactly do you mean? Do you want them deleted? Or is it good enough to simply identify them so you can take further action?

    Do you care about preserving the original order of lines in the file that needs to change (if a file will change)?

    It would be best if you could provide three

    sample text blocks (see FAQ, find section on "literal text boxes: used in many other posts on this site).

    https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts

    Show file1 sample text and file2 sample text, making sure to include both cases that do and do not have matches, maybe 5 - 20 lines each, and then in the third show exactly what you want to end up with.

    I’m fairly certain what you want can be done. If order preservation is important it might be a multi-step process.

  • D

    Disconnect on save with NPPFTP

    Watching Ignoring Scheduled Pinned Locked Moved nppftp
    3 Nov 16, 2022, 5:39 PM
    May 6, 2022, 7:39 AM
    0 Votes
    3 Posts
    1k Views
    I Nov 16, 2022, 5:39 PM

    I’ve recently returned to using NppFTP and have noticed the same thing - it’s very annoying!
    After finding the work-around I’ve described below, it leads me to believe that the problem (in my case) might be that the default cache location is not writable without admin privileges (which have recently been changed on my work PC due to a security breach).
    I haven’t ‘upgraded’ to Windows 11 yet, so can’t say whether Notepad++ is trying to cache the files a privileged location, but it worked for me.

    I found that the problem went away when I assigned a (writeable) local path to the external path. I haven’t had any problem since.

    I hope this helps.

    Untitled.png

  • J

    Macro for Open, Find and Replace and Save

    Watching Ignoring Scheduled Pinned Locked Moved
    22 Nov 16, 2022, 12:11 PM
    Nov 10, 2022, 3:42 PM
    0 Votes
    22 Posts
    5k Views
    J Nov 16, 2022, 12:11 PM

    @guy038 said in Macro for Open, Find and Replace and Save:

    Hello, @josé-luis-montero-castellanos, @aln-kilborn and all,

    @josé-luis-montero-castellanos, regarding your regex S/R :

    SEARCH (?s)(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S)

    REPLACE ?1\5\2\7\4\1\6\3:${12}${9}${14}${11}${8}${13}${10}

    Why do you need the leading in-line modifier (?s), in the search part ? Do you mean that the single char . in group 2, 4, 6, 9, 11 and 13 may also represent a line-break char ( \r or \n ) ?

    I suppose not ! Then, your correct search regex is rather :

    (?-s)(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S)

    where any . single char will represent a non-break char, only !

    Now, I noticed that the groups used, in replacement, for each alternative of the search regex, are in the same order ! Then, you can use, preferably, a specific feature of the Boost Regex engine, called Branch Reset

    For instance, in your regex, the numbers of each group are :

    (?-s)(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S) Gr : 1 2 3 4 5 6 7 |8 9 10 11 12 13 14

    If we use the Branch Reset feature the search regex becomes :

    (?-s)(?|(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S)) Gr: 1 2 3 4 5 6 7 |1 2 3 4 5 6 7

    Thus, your entire regex S/R can be simplified as below :

    SEARCH (?-s)(?|(<St)(.)(/S)(.)(<Xt)(.)(/X)|(<Xt)(.)(/X)(.)(<St)(.)(/S))

    REPLACE \5\2\7\4\1\6\3

    For instance, given this INPUT text :

    <St2/S4<Xt6/X <Xt9/XB<StD/S

    You would get the OUTPUT text, below :

    <Xt2/X4<St6/S <St9/SB<XtD/X

    Notes :

    The Regular expression option must be selected

    Preferably, tick the [Wrap around](https://www.ahijoy.com/) option

    Best Regards,

    guy038

    I tried it but didn’t work

  • M

    Make NPP list its current shorcut key assignments?

    Watching Ignoring Scheduled Pinned Locked Moved
    9 Nov 15, 2022, 8:24 PM
    Jan 20, 2016, 5:06 PM
    0 Votes
    9 Posts
    5k Views
    P Nov 15, 2022, 8:24 PM

    Future reference:

    More of the solution to this, with example scripts, is found here

  • S

    Replace specific line #s within multiple programs

    Watching Ignoring Scheduled Pinned Locked Moved
    8 Nov 15, 2022, 12:59 PM
    Nov 14, 2022, 8:08 PM
    0 Votes
    8 Posts
    829 Views
    A Nov 15, 2022, 12:59 PM

    @Scott-Raskin said in Replace specific line #s within multiple programs:

    how to replace that with all of that text below

    Arguably the easiest way is to do this:

    select your desired replacement text:
    955b70e6-212a-41a3-a9a9-1ba3ca2813f5-image.png

    press Ctrl+Shift+f to bring up Find in Files window; your desired replacement data will be in the Find what box (not in Replace with where you want it):
    c7416569-fac0-4b52-b7a4-75f5d8381692-image.png

    press the “up/down arrow” – aka “swap” – button to move your data from Find what to Replace with:
    61e5360d-2997-4480-a9c3-8df561aaf540-image.png

    put your search expression into Find what, and continue on with hopefully obvious steps to accomplish your replacement operation

  • A

    Closing when connecting

    Watching Ignoring Scheduled Pinned Locked Moved
    8 Nov 15, 2022, 12:40 PM
    Nov 12, 2022, 11:22 PM
    0 Votes
    8 Posts
    442 Views
    A Nov 15, 2022, 12:40 PM

    @ArlynSilverthorn

    If all you are capable of doing is saying “it doesn’t work”, then no one can help you. Please reference Peter’s prior post.

  • E

    File explorer initial remote directory - hide unwanted path from root

    Watching Ignoring Scheduled Pinned Locked Moved
    8 Nov 15, 2022, 3:28 AM
    Nov 14, 2022, 4:25 AM
    1 Votes
    8 Posts
    798 Views
    E Nov 15, 2022, 3:28 AM

    @PeterJones Yes, what you wrote is correctly what i have on mind.

    The reason why i dont want to see what is before initial dir is:

    waste of space on explorer annoying scrolling when there are more subdirs when you resume your work (after opening NPP) and you CTRL+S the file, File explorer starts from the root, which makes it very annoying to go back to the saved file position. Imagine i have like 10+dirs from the root.

    At the moment im doing it like this: I open NPP, i close all tabs which are already opened, then i connect to the server and open files again.

  • Roel JongmanR

    Delete some lines

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Nov 14, 2022, 11:55 AM
    Nov 13, 2022, 5:43 PM
    0 Votes
    3 Posts
    231 Views
    Roel JongmanR Nov 14, 2022, 11:55 AM

    Thank you Allan,

    I was aware of the find-and-replace option, but did not know how to select the whole line.
    I worked just fine for me.

  • ghwmorgG

    Windows Updates Problems

    Watching Ignoring Scheduled Pinned Locked Moved
    8 Nov 14, 2022, 3:43 AM
    Nov 13, 2022, 10:02 PM
    0 Votes
    8 Posts
    1k Views
    ghwmorgG Nov 14, 2022, 3:43 AM

    @Terry-R

    The funny thing is that before receiving for you, the idea of opening N++ without plugins, after Windows updates, N++ could not stay open. But it has been shown that without plugins; Yes.

    That information, as it is, is curious.

    Greetings.

  • rovitieR

    Remove columns

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Nov 13, 2022, 7:19 PM
    May 27, 2020, 3:56 PM
    0 Votes
    4 Posts
    18k Views
    TheNainBoyT Nov 13, 2022, 7:19 PM

    @guy038 you saved my life men , hats off u buddy…

  • Michael RochollM

    Printing also gives gray background

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Nov 13, 2022, 1:46 AM
    Nov 12, 2022, 5:03 PM
    0 Votes
    3 Posts
    422 Views
    Michael RochollM Nov 13, 2022, 1:46 AM

    @PeterJones said in Printing also gives gray background:

    @Michael-Rocholl ,

    See the “Known issues” section at the bottom of this FAQ.

    Thanks for quick response - Michael

  • Lycan ThropeL

    New NPP Install issues for UDL features install

    Watching Ignoring Scheduled Pinned Locked Moved
    14 Nov 12, 2022, 10:39 PM
    Nov 8, 2022, 5:27 AM
    0 Votes
    14 Posts
    823 Views
    Lycan ThropeL Nov 12, 2022, 10:39 PM

    @PeterJones ,

    Thanks for those clarifications. I’m glad I’m not going mad. :)

  • Mister MechM

    AutoHotkey: Ctrl+Shift+M adds blank line instead of triggering function

    Watching Ignoring Scheduled Pinned Locked Moved
    7 Nov 12, 2022, 3:43 PM
    Nov 11, 2022, 3:09 PM
    0 Votes
    7 Posts
    868 Views
    Mister MechM Nov 12, 2022, 3:43 PM

    Yeah, it turned out to be the unmapped shortcuts. Thanks to everyone for the detailed explanations. It helped with this and it will help in the future.

  • GedijorgeG

    Folding and collapsing indented children. Possible?

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Nov 12, 2022, 1:43 PM
    Nov 12, 2022, 8:58 AM
    0 Votes
    4 Posts
    321 Views
    GedijorgeG Nov 12, 2022, 1:43 PM

    @Alan-Kilborn
    Thank you! 🤗 Works the way I wanted. 🎉
    In combination with the shortcuts it should be very handy.

    aa.jpg

  • M Andre Z EckenrodeM

    Wonky display of double musical note character

    Watching Ignoring Scheduled Pinned Locked Moved font display bug maybe unicode
    8 Nov 10, 2022, 6:43 PM
    Nov 10, 2022, 2:54 PM
    1 Votes
    8 Posts
    533 Views
    P Nov 10, 2022, 6:43 PM

    Aside: the font that my browser is using for monospace has a mistake in its gylphs:
    1db47ef2-3de0-47a8-b4cb-28d310f10872-image.png
    The non-monospace font (in black) correctly shows U+266B ♫ as beamed eighth notes. The monospace font (in red) shows that same character as beamed sixteenth notes instead. Whoops.

    No, my browser says it’s using DejaVu Sans Mono for fixed-pitch, and charmap shows that DejaVu Sans Mono has four separate glyphs for those notes.

    80ece08d-4d00-43ba-8b7f-ac1b8571b218-image.png

    And Notepad++, which is set to use the same font as well, shows the correct glyphs for those four characters
    869ae6ca-141c-43f1-bde4-9f9d91a7039e-image.png

    Oh, I bet that the forum stylesheets are overriding my font choices.

    -----
    Edit: Yes, the CSS has its own list of fonts before using what the browser is set at. How rude. 24c7109c-0a36-4420-abd1-a3dd122fd0ab-image.png

    I don’t have Menlo or Monaco, so it would try Consolas, which doesn’t have that glyph, then Courier New, which doesn’t either, then monospace … so it should be trying DejaVu Sans Mono at that point… but doesn’t seem to be. Oh well, browser issue.

  • Dimitri SudomoinD

    (Pythonscript) Status bar to display word count & understanding SCINTILLANOTIFICATION

    Watching Ignoring Scheduled Pinned Locked Moved
    5 Nov 10, 2022, 5:11 PM
    Nov 10, 2022, 3:36 PM
    4 Votes
    5 Posts
    514 Views
    Dimitri SudomoinD Nov 10, 2022, 5:11 PM

    @Alan-Kilborn said in (Pythonscript) Status bar to display word count & understanding SCINTILLANOTIFICATION:

    Is this causing some sort of problem for you, or does it merely bother you?

    Mostly the latter, haha.

    In any case, I don’t really notice any impact on performance so I’m going to let it go. Here is my final script that I ended up writing for those that come along and want to see it.

    from re import findall def callback_sci_UPDATEUI(args): SPEECH_SEC_PER_WORD = 0.66 # 0.55 = fast, 0.66 = normal, 0.75 = paused if editor.getTextLength() < 100000 and args['updated']: # don't search "big" files if editor.getSelections() == 1 and not editor.getSelectionEmpty(): # show word count for selection text = editor.getSelText() sel_info = ' (For Selected)' else: # show word count for entire document text = editor.getText() sel_info = '' word_count = len(findall(r'\w+', text)) speech_minutes = (word_count * SPEECH_SEC_PER_WORD / 60) % 60 speech_seconds = (word_count * SPEECH_SEC_PER_WORD) % 60 speaking_time_str = "%02dm%02ds" % (speech_minutes, speech_seconds) sbar_value = 'Words: {} Speaking Time: {}{}'.format(word_count, speaking_time_str, sel_info) notepad.setStatusBar(STATUSBARSECTION.DOCTYPE, sbar_value) editor.callback(callback_sci_UPDATEUI, [SCINTILLANOTIFICATION.UPDATEUI])
  • lamprey13L

    N++ Tabs Setting

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Nov 9, 2022, 7:51 PM
    Nov 9, 2022, 7:09 PM
    0 Votes
    4 Posts
    303 Views
    A Nov 9, 2022, 7:51 PM

    @lamprey13 said in N++ Tabs Setting:

    please delete

    Only you can remove your postings, but there’s no harm in leaving it.

  • W

    Open Notepad++ via command line with a certain character set

    Watching Ignoring Scheduled Pinned Locked Moved
    14 Nov 9, 2022, 6:54 PM
    Mar 30, 2020, 2:29 PM
    1 Votes
    14 Posts
    2k Views
    A Nov 9, 2022, 6:54 PM

    Earlier I had said:

    IMO, it makes more sense to have your proposed command line work as follows:

    notepad++ yourfile1.ext -charset=“OEM 850” yourfile2.ext -charset=“UTF-8 BOM” yourfile3.ext yourfile4.txt

    While that’s an idyllic command line, logically, it doesn’t really suit how Notepad++ currently works; example:

    notepad++ -multiInst -n15 yourfile1.txt -n10 yourfile2.txt

    While this will open “yourfile1.txt” at line 15, it will NOT open “yourfile2.txt” at line 10.

    But this:

    notepad++ -multiInst -n15 yourfile1.txt yourfile2.txt

    will open both files at line 15.

    So I think it is reasonable to allow only one -charset=... on a command line, that affects all following files; example:

    notepad++ yourfile1.ext -charset="UTF-8 BOM" yourfile3.ext yourfile4.txt <-- contains only ONE charset directive.

    If a second -charset is encountered on the command-line, it would be ignored.

  • J

    find the same characthers and replacment incremental value in files in folder

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Nov 9, 2022, 1:58 PM
    Nov 9, 2022, 5:53 AM
    0 Votes
    3 Posts
    452 Views
    P Nov 9, 2022, 1:58 PM

    @Jimmy-C_1013 ,

    If I am understanding correctly, you have hundreds/thousands of files, each with a particular naming scheme. Inside each of these files, you have the word number at least once, and you want to replace that word with part of the filename (extracted from the filename, based on the scheme you mentioned).

    Notepad++ search-and-replace does not have access to the filename, so it cannot be done natively inside Notepad++.

    However, by a clever combination of command-line and Notepad++ manipulation, you may be able to implement something that will work for you. For example, earlier this year someone asked about just inserting the whole filename into their file(s) overtop of a PLACEHOLDER variable in the discussion here – my reply, and the follow-ons, show one way in which this can be accomplished. Using the same command-line portion, and then tweaking the regex to use number instead of PLACEHOLDER should get you pretty close to what you want.

    Good luck.

    ----

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

    accented characters as hex

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Nov 9, 2022, 7:58 AM
    Nov 8, 2022, 11:20 PM
    0 Votes
    3 Posts
    1k Views
    gerdb42G Nov 9, 2022, 7:58 AM

    @Zsolt-Tomo,

    your xml file should have an XML-Prolog in the first line which states the encoding to use:
    <?xml version="1.0" encoding="Windows-1252"?>
    If this line is missing, UTF-8 will be assumed since that is the default for XML files. If the prolog is set, the XML-lexer will set the document encoding accordingly.

The Community of users of the Notepad++ text editor.
Powered by NodeBB | Contributors