• Want to delete the first paragraph of each line?

    Locked
    9
    0 Votes
    9 Posts
    4k Views
    guy038G

    Hello, @ty-ty,

    Seemingly, Ty-Ty, you’re asking for three different points :

    A : How to delete some structured data, located at each beginning of line ?

    B : How to delete some structured data, located at each end of line ?

    C : How to add a string at each end of line ?

    Just note that the points B and C may be replaced with :

    D : How to replace some structured data, at each end of line, by a literal string

    So, let’s imagine your initial list, opened in Notepad++ :

    *363780 willtall@gmail.com:xenogears *363781 kaansoulp@gmail.com:kaan1976 *363782 angelica.valila@gmail.com:pissis69 *363782 angelica.valila@gmail.com:pissis69 *363784 twsnyderman@yahoo.com:sdchbltmvp *363785 shaunamiekley@gmail.com:lfhs929 *363786 kynajo@gmail.com:jehovah1 *363787 stynrynn@gmail.com:satya96 *363788 haleyottley@gmail.com:haley0ttley *363789 pandemonium.jones@gmail.com:odder7471 *363790 marielle_koudijs@hotmail.com:Larissa18 *363791 robnoice@gmail.com:robtb303 *363792 willtall@gmail.com:xenogears *363793 kaansoulp@gmail.com:kaan1976 *363794 angelica.valila@gmail.com:pissis69 *363795 megsellig@gmail.com:bhyc9999 *363796 twsnyderman@yahoo.com:sdchbltmvp *363797 shaunamiekley@gmail.com:lfhs929 *363798 kynajo@gmail.com:jehovah1 *363799 stynrynn@gmail.com:satya96

    Obviously, we can deduce that :

    The part to delete, at the beginning, of each line ( Case A ) :

    Begin by possible space characters, followed by a * symbol

    Then followed by some digits ( 6 in our example ) and ends with possible space characters

    The part to delete, at the end, of eech line ( Case B ) :

    Begin with the unique colon of each line, followed by all the remaining characters of each line

    So, to achieve point A :

    Open the Replace dialog ( Ctrl + H )

    Type in the regex ^\x20*\*\d+\x20*, in the Find what: zone

    Leave the Replace with: zone EMPTY

    Check the Wrap around and Regular expression options

    Click on the Replace All button

    Notes :

    The ^ symbol means the beginning of line location

    Then, the syntax \x20* represents a string, possibly empty, of space characters

    The form \* try to match a literal star character. It must be escaped, due to its special meaning in regexes

    And \d+ stands for a non-empty range of consecutive digits

    Again, \x20* matches a string, possibly empty, of space characters, before each e-mail address

    To achieve point B :

    Open the Replace dialog ( Ctrl + H )

    Type in the regex :.+, in the Find what: zone

    Leave the Replace with: zone EMPTY

    Check the Wrap around and Regular expression options

    Click on the Replace All button

    Notes :

    First, the : matches a literal colon symbol

    Then the syntax .+ represents any non-empty range of characters, located after the colon, till the end of each line

    But, you may combine all these search-replacements, in an unique regex

    Therefore, to achieve points A and D, at the same time, use the regexes, below :

    SEARCH ^\x20*\*\d+\x20*|(:.+)

    REPLACE ?1\x20\x20\x20\x20\x20\x20Love

    Notes :

    The search regex is just an alternative between the two regexes, discussed above

    The second regex (:.+) is surrounded by round parentheses, to be stored as group 1

    In replacement, the form ?1....... means :

    If group 1 exists, just replace the colon and all text, located after, by six space characters, followed by Love

    If group 1 does not exist, delete all text, before each e-mail address, as the ELSE part of this conditional replacement is absent !

    So, after a click on the Replace All button, you should get the text below :

    willtall@gmail.com Love kaansoulp@gmail.com Love angelica.valila@gmail.com Love angelica.valila@gmail.com Love twsnyderman@yahoo.com Love shaunamiekley@gmail.com Love kynajo@gmail.com Love stynrynn@gmail.com Love haleyottley@gmail.com Love pandemonium.jones@gmail.com Love marielle_koudijs@hotmail.com Love robnoice@gmail.com Love willtall@gmail.com Love kaansoulp@gmail.com Love angelica.valila@gmail.com Love megsellig@gmail.com Love twsnyderman@yahoo.com Love shaunamiekley@gmail.com Love kynajo@gmail.com Love stynrynn@gmail.com Love

    Remark : In the regexes, you may type a single space character, instead of the \x20 syntax ! But, that later form just suppresses any ambiguity !

    Best Regards,

    guy038

  • Removal of Blank Lines in a large number of files

    8
    0 Votes
    8 Posts
    14k Views
    Nguyễn Huy HảiN

    Hi @Scott-Sumner
    Thanks for your reply!

    I had my doubt so I went to turn on Show white space and TAB but nothing shown (in pix below)
    https://cdn.discordapp.com/attachments/311547963883388938/406663528154529823/unknown.png

    I used echo command to add the last line to the text file but that commands also generates another empty line that follows. That’s why I need to remove it.

    After a bit of googling, I found that [\n\r]+$ works. I’m happy but still curious about the differences between multiple regex.

  • Notepad ++ crashes when using Babylon Translator

    Locked
    15
    0 Votes
    15 Posts
    5k Views
    chcgC

    You could also use the plugin https://sourceforge.net/projects/npptranslate/files/bin/Translate_3.1.1.0.zip, if getting translations from within N++ is your main focus.

    Just tested it with some simple testfile. Works ok, if it is UTF-8, but after change of encoding to ANSI babylon causes a crash. I think this is not caused by N++ itself.

    Also happens for the x64 version of N++:

    gdi32.dll!IsCreateFontIndirectAPresent() Unbekannt Nichtbenutzercode. Symbole wurden geladen.
    gdi32.dll!TranslateCharsetInfoStub() Unbekannt Nichtbenutzercode. Symbole wurden geladen.
    captlib64.dll!00007ffb47446d53() Unbekannt Es wurden keine Symbole geladen.
    captlib64.dll!00007ffb474455d6() Unbekannt Es wurden keine Symbole geladen.
    captlib64.dll!00007ffb47445cf8() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d531b4e() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d531dae() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d5242e7() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d52dfb2() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d5131d7() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d513731() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d545835() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d5472f8() Unbekannt Es wurden keine Symbole geladen.
    SciLexer.dll!00007ffb2d54b774() Unbekannt Es wurden keine Symbole geladen.
    [Externer Code] Frame mit Anmerkungen
    notepad++.exe!00007ff71f645c39() Unbekannt Es wurden keine Symbole geladen.
    notepad++.exe!00007ff71f645e06() Unbekannt Es wurden keine Symbole geladen.
    [Externer Code] Frame mit Anmerkungen
    notepad++.exe!00007ff71f67c008() Unbekannt Es wurden keine Symbole geladen.

  • Change color/appearance of whitespace characters

    Locked
    3
    1 Votes
    3 Posts
    2k Views
    Waqas IlyasW

    I didn’t know we could choose to just show the whitespaces other than EOL characters. Solves half of my problem. Better than nothing.
    “View Menu > Show Symbols > Show Whitespace and TAB”

    Thanks a lot!

  • Add delimiter - simple but not for begginer

    Locked
    3
    1 Votes
    3 Posts
    1k Views
    Alec TellA

    Thank you, looks so simple and elegant that makes me think where my “open minded” has gone.
    Will try it.

  • Default remove all empty lines?

    Locked
    3
    1 Votes
    3 Posts
    1k Views
    frederick22F

    Thanks Scott Sumner, that’s doing it fine.

  • highlighting for prolog does not work

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Jim DaileyJ

    @Doug-Skuce

    I assume by “this” you mean a user-defined language definition for prolog. If that is correct, all you should need to do is select prolog from the language menu.

    Once the user-defined language has been imported (or defined), then whenever you open a file in the editor having the file extension specified in the language’s definition, the file should be syntax highlighted automatically.

  • begining and end of line

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Pouemes44P

    @Scott-Sumner said:

    Find what zone: (?-s)^word1.*\R
    Replace with zone: $0word2\r\n
    Match case checkbox: your choice if you need it ticked or not
    Search mode: Regular expression

    thanks scott works perfectly

  • Rare Null Write Glitch

    19
    1 Votes
    19 Posts
    11k Views
    chcgC

    See https://github.com/notepad-plus-plus/notepad-plus-plus/issues/2883#issuecomment-360502864 might be interesting:

    After a Notepad++ crash with nullified file(mostly after save the file), you can try to restart notepad++! by executing the .exe directly. It comes up with a message that ‘another program changed your nullified file’ and it will ask to reload the file. DON’t reload (it is nullified in the original map) but after give your answer (DON’t reload) Notepad++ comes up with the nullified file: magical is not? Somewhere in memory it is keep alive!!
    Hopefully this saved other people some headaches!! It was for me.

  • 0 Votes
    9 Posts
    11k Views
    Claudia FrankC

    @dreamforceinc

    the result is stored in variable msg_result, so something like

    SCI_SENDMSG 2087
    echo $(MSG_RESULT)

    would do the job.

    Cheers
    Claudia

  • 0 Votes
    8 Posts
    4k Views
    ?

    It appears this is a Scintilla bug. Scintilla is a vital component of NP++ and several other text editor-type programs, which are probably all exhibiting this behavior.

    Bug reports:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3895
    https://sourceforge.net/p/scintilla/bugs/1983

    If you, like me, value ‘tap twice’ word selection over ‘tap twice and drag’ multi-select, follow this workaround:

    Go into Windows 10 ‘Touchpad settings’ Disable ‘Tap twice and drag to multi-select’
  • "Style found token" not an option anymore

    Locked
    5
    1 Votes
    5 Posts
    2k Views
    Chuchulo HatyzakC

    Great, thanks.
    Ch

  • 1 Votes
    3 Posts
    1k Views
    Scott SumnerS

    @jacobscrackers

    So as an example, try this in the Run (menu) -> Run… -> The Program to Run box:

    cmd /K echo $(FULL_CURRENT_PATH)

    As to "can I set a default for a particular file type? ", you’ll have to be more specific…

  • changing modified date

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    Scott SumnerS

    I can almost taste the cookies

  • Append character at end of line

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Rod NunleyR

    That did the trick. Exactly what I needed. Thanks much.

  • Can't log into local server with NppFTP plugin

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    Thomas RyanT

    @chcg Thank you chcg
    I think am in way over my head… will persevere though.

  • how to remove repeated lines created from hex please help

    Locked
    4
    0 Votes
    4 Posts
    1k Views
    Dahaka pD

    @MAPJe71
    Thank you very much , am testing now .

    @ Scott Sumner
    I did several searches at google but not point me to here , i didn’t search here but next time i’ll do , Thanks for the screen shoot .

  • Find & Replace options

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Kieren-Baillie said:

    with regular expression checked and a look ahead regex in find what like

    (?-s)^.*(?=\Rfile = open\(first_program_used\))

    you should be able to to find the line prior to file = open …

    Note: in replace with you need to escape the \first by \\first so it looks like

    first_program_used = main_address + r"\\first_program_used.txt"

    Cheers
    Claudia

  • 0 Votes
    3 Posts
    1k Views
    guy038G

    Hi, @Jesper-Bødewadt-Møller,

    I would use this strategy :

    If we find some digits, right after the syntax %X, just rewrite this NON wanted block, as it !

    If we find other 3 digits elsewhere ( which are good candidates ), replace each one with a 4 digit

    This simple way avoid us to verify where a 3 digit is found ( inside a %X... block or elsewhere :-))

    So, open the Replace dialog ( Ctrl + H )

    SEARCH (?-i)%X\d+|(3)

    REPLACE ?{1}4:$0

    OPTIONS Wrap around and Regular expression ticked

    ACTION Click on the Replace All button

    For instance, assuming the initial text below :

    abc3.%X31 def abc3%X11223def abc3%X773777.3def abc3%X31 333def abc3% X321 333def abc3%X 321 333def abc333.%X333333.333def

    It would be changed into :

    abc4.%X31 def abc4%X11223def abc4%X773777.4def abc4%X31 444def abc4% X421 444def abc4%X 421 444def abc444.%X333333.444def

    Remark :

    Just note that the 3 digits are replaced by a 4 digit , in the parts % X321 and %X 321, as they are not exactly of the form %Xdigitdigit…digit !!

    Notes :

    The modifier (?-i) forces the search to be NON-insensitive to case ( so sensitive ! )

    Then the regex engine looks for, either :

    The exact string %X, followed by, at least, one digit ( %X\d+ )

    Any digit 3, stored as group 1, because of the surrounding parentheses ( (3) )

    In replacement :

    If group 1 exists ( second alternative ), we replace with a single 4 digit ( part before the colon )

    ELSE, we just rewrite the entire matched string %X##### ( regex $0 , after the colon )

    Best Regards,

    guy038

  • Where in Notepad++ is the guide for Bold, Italics, etc?

    Locked
    7
    0 Votes
    7 Posts
    108k Views
    Claudia FrankC

    @Libby-Len-Traubman

    so I assume your initial question about bold, italic was also related to html programming?

    If so, yes you can use npp to create webpages but notepad++ doesn’t have any help file
    how to create a webpage.
    What you can do is to use web resources like https://www.w3schools.com/
    and once you’ve written your code use run menu and one of the browser functions like
    launch in firefox etc…
    But, again, notepad++ does not provide all those browsers it just assumes
    that you have, at least one, installed, and tries to start it with the current document open as parameter to the browser executable.

    Cheers
    Claudia