• [7.8.6] Closing tabs order.

    9
    1 Votes
    9 Posts
    2k Views
    Alan KilbornA

    @Donatas-Mačiūnas said in [7.8.6] Closing tabs order.:

    the settings section explicitly notes in the title/label that this behavior applies to Ctrl+TAB

    Isn’t hardcoding “Ctrl+Tab” on the user interface a “bad thing”??
    I mean, I can assign any (unrelated) function I want to “Ctrl+Tab”…and now that verbage on that setting in the Preferences doesn’t make any sense, because now my Ctrl+Tab combo opens up an Explorer window (for example).

    This seems odd. If a program is going to take over Ctrl+Tab for a specific purpose, that’s fine, but it should be disallowed to use that combination for other things in Shortcut Mapper then…

  • How to delete text after the 2nd specific character in each row

    16
    0 Votes
    16 Posts
    1k Views
    Thomas 2020T

    Schowek04.jpg

    ^((\w+ \| ){2})(.+)

    can be replaced individually

  • 0 Votes
    7 Posts
    608 Views
    Alan KilbornA

    @Camillia-Wee said in How to extract data from a table in excel using javascript?:

    because im using notepad++ to create the webpage

    COOKIES!

  • Is there a way to add an "enter" as part of a replace command?

    5
    0 Votes
    5 Posts
    631 Views
    Thomas 2020T

    or: Extended
    |-
    |-\r\n

  • written txt file in english, saved it. It changed to gibberish

    8
    0 Votes
    8 Posts
    2k Views
    EkopalypseE

    @Ekopalypse

    In addition you can check if your %appdata%\notepad++\backup directory contains something usable.

  • How to remove middle text?

    22
    0 Votes
    22 Posts
    3k Views
    Thomas 2020T

    it can also be so

    ^([^:\n]+)(:)((?1))
    \1

  • Style token disappears after close notepad and reopen file

    2
    0 Votes
    2 Posts
    675 Views
    EkopalypseE

    @Donald-Milotte

    That is normal. Npp is not MS Word where style information is stored in the file.
    Npp is a pure text editor. The reason why for example python code is
    always displayed in color is that there is a so-called lexer which scans the
    file according to previously created rules and colors it accordingly.
    For files that can not be assigned to a builtin lexer you can create UDLs, user defined lexers.
    Whether this is useful in your case or not, I can not say from the given information.

  • creating your own "language" ...

    4
    0 Votes
    4 Posts
    277 Views
    EkopalypseE

    @Sebastjan

    without knowing what the second half should be it is hard to tell what can be done in addition.

  • Find specific string in file 1 and replace in specific lines in file 2

    2
    0 Votes
    2 Posts
    307 Views
    Terry RT

    @Denis-Sta said in Find specific string in file 1 and replace in specific lines in file 2:

    Does anyone can give me some hints from where to start?

    Well I’d say you are going to have to merge the 2 files if you want regex (regular expression) to do the work. That’s not as bad as it sounds. There have been several discussions in the past on this forum regarding similar needs to yours. I think most have had solutions found using just regexes.

    The alternative would be a scripting language, Python is one amongst many that Notepad++ supports. But the issue here will be to have someone create a program for you in that language or will you need to learn it yourself.

    In broad terms I’d:

    Make the several lines in each file become one for each “record” Sequence up an ascending number at the start of each line, sort of a line number, odds for 1 file, evens for the other. The lines in file 1 may not be required to have an ascending number at the front but I’ve included it for the time being. Have at the front of each line in both files the appropriate sequences of text you will be using to find the lines. Sort the lines (once both files merged) in ascending order. This will “pair” records together. Use a regex to update the record in the line from file 2 from it’s “pair”. Use a regex to remove the lines from file 1 and to also remove the “sort text” at the front of line. Sort the lines again with the “line number” from step 2. This will put them back in “original order”. Pull apart the lines so they look as they did originally, but now with the additional information you wanted added.

    I replied to someone else recently that often a “BIG” problem like yours looks insurmountable. That is until we break it down into little steps, each then becomes fairly simple to code.

    Terry

  • How to insert text at the end of every url (via a macro)?

    7
    0 Votes
    7 Posts
    816 Views
    khk khkK

    Dear Peter,

    this was the information I needed; now the macro works fine.

    Lots of thanks to all who (tried) to help me.

    Kr

    Kurt

  • RegEx text search

    2
    0 Votes
    2 Posts
    141 Views
    No one has replied
  • Unable to Allow regex backward search

    2
    0 Votes
    2 Posts
    190 Views
    EkopalypseE

    @Matthieu-gabrielli

    I don’t think you’re using the regex backwards search.
    At least the screenshot doesn’t show that you do as you have to tick
    the little checkbox next to Find Next button to see the forward and backward search buttons.

    c7923036-3820-4eac-8060-8b291fef7c49-image.png

    But I don’t think it is needed in your case.
    Strange that this basic regex is not working in your case, are you sure
    you haven’t, by accident, added an additional space to find what?
    Or maybe this document is using linux eol instead of windows eol?

  • "Find Previous" custom keyboard shortcut not working in v7.8.9

    5
    0 Votes
    5 Posts
    360 Views
    I

    That fixed it! Thank you so much @Ekopalypse!

  • Settings Preferences issue

    3
    0 Votes
    3 Posts
    222 Views
    Tim MartinT

    @PeterJones
    Holy cow, I am incredibly embarrassed. I have my screen setup with notepad++ in the upper left corner and when I go to preferences, what I pasted into my post was all I was seeing. After I saw your post I did it again and scooted the window over and – well, thanks for helping me find what was there all along…

  • How to insert text at the end of every url?

    3
    0 Votes
    3 Posts
    925 Views
    PeterJonesP

    @Rob-K ,

    I just said:

    FIND = (?i-s)^\h*https?://test.domain\S* REPLACE = $0 new stuff

    The FIND would be better as:

    FIND = (?i-s)^\h*https?://test\.domain\S*

    Quick explanation of the regex:

    the stuff in parentheses set up options to make it case insensitive and to not let . match newline

    ^ means the match starts at the beginning of the line

    \h* allows 0 or more horizontal spaces (tabs and space characters) before the url

    https?:// allows either http or https

    \. escapes the ., so it means a literal domain separator, not the regex wildcard character

    \S* means that there can be 0 or more additional non-space characters after the domain; since the end-of-line sequence counts as space character, it will stop at the end of the line if there’s nothing after the URL

    $0 in the REPLACE means the entire matched text – so everything from beginning of line to just before the first space (or end-of-line).

    new stuff indicates the new text you want to add

    This means that the replacement will still include the original URL, plus the new stuff.

  • Synchonize by line

    2
    0 Votes
    2 Posts
    156 Views
    EkopalypseE

    @Laurent-Cnoname

    Not as far as I know. You could of course turn off the word wrapping
    but you probably have that on to avoid horizontal scrolling, haven’t you?

  • I would like to find lines where there are 2x double spaces

    18
    0 Votes
    18 Posts
    2k Views
    Thomas 2020T

    this is it:
    Schowek02.jpg

  • File text replaced with "NuL", how do i see/recover it?

    6
    0 Votes
    6 Posts
    1k Views
    sgtsixpackS

    I just created a list of files using defraggler and npp showed the same behavior. When I tried to open it in microsoft notepad although it took a lot longer the data was intact. I know its a bit late but if have u tried notepad to read your “important” codes?

  • golang..

    2
    0 Votes
    2 Posts
    170 Views
    EkopalypseE

    @JACKCHEN213

    There is an udl for golang here.

  • 0 Votes
    2 Posts
    194 Views
    EkopalypseE

    @Mark-Tinney-0 said in Python runs differently in NPP Exec Console vs Windows Console.:

    prefix = ’ ’
    body = ‘┌──────────────────────────────────────────────────────────────┐’
    suffix = ’ ’

    print(prefix+body+suffix)

    Is this something you have under your control?
    If so, you could create a unique environment variable and check this from your script.
    Something like this.

    In NppExec execute you do

    NPP_SAVE $(FULL_CURRENT_PATH) set_env CALLED_FROM_NPP_EXEC=1 D:\ProgramData\Python\Python_embed_382_64\python.exe "$(FULL_CURRENT_PATH)" env_unset CALLED_FROM_NPP_EXEC

    and in python script you do

    import os print(f'{"CALLED_FROM_NPP_EXEC" in os.environ = }')