• the compare function is failing. only a ctrl+f finds this exact duplicate

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Alan KilbornA

    @Dave-Lafontaine

    To obtain help here, you need to be able to write a coherent, understandable question. Yours makes little if any sense. If you work in the computer security realm, I hope you put more care into that work than you did with your post. I also hope you rephrase your inquiry, because there are people here that can and will help, if they can understand what you need.

  • Skip duplicate words at beginning of the line

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    guy038G

    Hello kreien,

    I was pretty sure that your sorted list could be modified with a regex S/R. Unfortunately, I was unable to perform what you want to, in one go :-(( Luckily, with two successive S/R, it’s quite OK !

    First of all, add a dummy line, just before the first line of your list ( xxxx[TAB]xxxx )

    We’ll also need a dummy character, not used yet, in your file, to identify specific lines. I chose the # symbol but any other symbol may be used. Just escape it if this symbol is a special regex character !

    Two hypotheses :

    I supposed that each line of your sorted list are NOT preceded by some blank characters, which could be different, between two consecutive lines !

    I supposed that you don’t care about the case of the text, before the first tabulation character

    So, we start, for instance, with the sorted example text, below :

    xxxx xxxx Garden following text garden following text Garden following text Garden following text Green following text House following text House following text house following text street following text Street following text Wall following text

    As you can see, the lines, beginning with House, are located after those beginning with the word Green. Better for a sorted list, isn’t it ?

    The first regex S/R, below, will add a # symbol at the end of, either , any single line and OR the last line of a group

    SEARCH (?i-s)^(.+?)\t.+\K\R(?!\1)

    REPLACE #$0

    NOTES :

    The part (?i-s) forces the regex engine to consider the dot character, ., as a single standard character, only and that all the process is done, in an insensitive way !

    Then, the part ^(.+?)\t represents, from beginning of line, the shortest range of standard characters, followed by a tabulation character. This range is stored as group 1, due to the surrounding round brackets

    The part .+, matches all the remaining standard characters, of the line, after the first tabulation

    The final part \R(?!\1) represents the End of Line character(s) of the current line, followed by a negative look-ahead, that is to say a condition which must be true for the regex engine considers the overall match. So, the beginning of the next line must be different from the beginning of the previous one ( \1 )

    Finally, the syntax \K forces the regex engine to forget all text matched, before \K. So, this search regex just matches the End of line character(s) of the current line, if next line does NOT begin with the same string beginning the current one

    So, in replacement, these End of Line character(s) ( the whole regex $0 ) are re-written, preceded by a # symbol

    And we obtain the changed text, below :

    xxxx xxxx# Garden following text garden following text Garden following text Garden following text# Green following text# House following text House following text house following text# street following text Street following text# Wall following text#

    The second regex S/R, below, deletes any # symbol, as well as any text, till the first tabulation character, in all the lines whose the previous line does NOT end with a # symbol

    SEARCH (?-s)#|[^#\r\n]\R\K.+?(?=\t)

    REPLACE EMPTY

    NOTES :

    Refer above, for the (?-s) syntax

    The first part of the alternative, |, matches a possible # symbol, at the end of a line

    The second part of the alternative, [^#\r\n]\R, looks for a last standard character, different from a # symbol, followed by the End of Line character(s)

    Then the \K syntax, again, reset the regex engine search location, at beginning of the next line

    Finally, the part .+?(?=\t) just matches the shortest range of characters, which is followed by the first tabulation character, of the next line

    In replacement, either, the # symbol OR all the characters, before the first tabulation, when the previous line does NOT end with a # symbol, are, simply, deleted

    So, we get the final text :

    xxxx xxxx Garden following text following text following text following text Green following text House following text following text following text street following text following text Wall following text

    To end with, delete the dummy first line. Et voilà !

    IMPORTANT :

    As we use the \K syntax, in the two S/R, you must click on the Replace All button, exclusively ! Don’t use the Replace button, ( step by step replacement ) for these S/R !

    Best Regards,

    guy038

  • Sort order of tab bar

    Locked
    6
    0 Votes
    6 Posts
    7k Views
    Claudia FrankC

    If you start npp with the remember current session … setting
    (Settings->Preferences->Backup)
    but this doesn’t work if you open npp from the commandline with a wildcard flag.

    Or you could save this session and start npp from the command line with the -openSession filename
    parameter.

    Cheers
    Claudia

  • Find in Files - search only files with no extension

    6
    0 Votes
    6 Posts
    6k Views
    Scott SumnerS

    @John-Bowman

    If you don’t mind the idea of creating some new commands (one-time-only) and executing TWO additional steps (every search), here is a workaround for Notepad++'s current inability to search in extensionless files.

    Your workflow will be slightly modified:

    Step 1: Run command “Rename *. to *.NOEXT” (defined below) on the Run menu to rename extensionless files to have extension “.NOEXT” (while you are editing any top-level file in the search tree that has a real extension)
    Step 2: Run your desired search; add *.NOEXT to list of filespecs to search
    Step 3: Run command “Rename *.NOEXT to *.” (defined below) on the Run menu to rename .NOEXT files back to being extensionless (again, while you are editing any top-level file in the search tree that has a real extension)

    Details of command “Rename *. to *.NOEXT”:
    One-time setup:
    In Notepad++'s Run menu, choose Run…
    Paste the following in “The Program to Run” box:
    cmd /c cd $(CURRENT_DIRECTORY) & For /R %G in (*.) do REN "%G" "%~nG.NOEXT"
    Press the Save button and name it something meaningful like “Rename *. to *.NOEXT”
    After accepting the name via the OK button in the “Shortcut” window, press the Cancel button in the “Run…” window (yes, seems like the wrong thing to do).

    Details of command “Rename *.NOEXT to *.”:
    One-time setup:
    In Notepad++'s Run menu, choose Run…
    Paste the following in “The Program to Run” box:
    cmd /c cd $(CURRENT_DIRECTORY) & For /R %G in (*.NOEXT) do REN "%G" "%~nG."
    Press the Save button and name it something meaningful like “Rename *.NOEXT to *.”
    After accepting the name via the OK button in the “Shortcut” window, press the Cancel button in the “Run…” window.

    Thanks to this website for some helpful info on renaming files: http://ss64.com/nt/ren.html

  • Unattended Installation (Auto Update Disabled)

    5
    0 Votes
    5 Posts
    16k Views
    Stephan MaucherS

    @fralbert Yeah! Would never have tested that. Thanks 1k!

  • Add the chapter title on each line with REG-EXP

    5
    0 Votes
    5 Posts
    3k Views
    guy038G

    Hello, Trucide Polère and Claudia,

    Trucide, I also found two S/R to achieve what you would like to but, compared to the Claudia’s solution, the second S/R needs to be run, once only :-))) So, just click on the Replace All button, once for each S/R !

    My solution works :

    Whatever the location of the word “Chapter”, in current line

    Whatever the number value, of the word “Chapter” ( Numeric sort not needed )

    Whatever the case of the word “Chapter

    If blank line(s) is(are) inserted between two chapters

    If blank line(s) is(are) inserted between two lines of a chapter

    Remark : These regexes need an extra character, which must NOT exist, yet, in your file. I chose the # symbol but any other symbol may be used. Just escape it if this symbol is a special regex character !

    So, given the example text, below, with 3 blank lines after “line 10” :

    Chapter 156 line 1 line 2 line 3 line 4 line 5 Chapter 2 line 5 line 6 This is a test : chapter 37 line 7 line 8 line 9 line 10

    The first regex S/R, below, adds a line, beginning with a # symbol and followed by the number of the current chapter, just before the line, containing the next word chapter, whatever its case OR before the very end of the file

    SEARCH (?i)Chapter\h+(\d+)(?s).+?(?=(?-s).*Chapter|\z)

    REPLACE $0#\1\r\n

    So it gives the changed text, below :

    Chapter 156 line 1 line 2 line 3 line 4 line 5 #156 Chapter 2 line 5 line 6 #2 This is a test : chapter 37 line 7 line 8 line 9 line 10 #37

    The second regex S/R, below :

    search for a complete line, beginning with a # symbol, and deletes it

    search for a non-empty line, which does not contain the word Chapter, whatever its case but it’s followed, further on, by the nearest # symbol with its number, stored as group 1 then adds this number, followed by a dash, in front of each line, during replacement

    SEARCH (?i-s)^#.+\R|(?!.*Chapter)^.+(?=(?s).+?#(\d+))
    REPLACE ?1\1-$0

    So, we obtain the final text, below :

    Chapter 156 156-line 1 156- line 2 156-line 3 156- line 4 156-line 5 Chapter 2 2-line 5 2-line 6 This is a test : chapter 37 37-line 7 37- line 8 37- line 9 37-line 10

    Best Regards,

    guy038

    Note : as usual :

    The modifier (?-s) means that further dot character ( . ) stands for any single standard character, except for any End of Line character

    The modifier (?s) means that further dot character ( . ) stands for any single character, included End of Line character

    The modifier (?i) means that the regex search is performed in an insensitive way

    The modifier (?s) means that the regex search is performed in a sensitive way

  • Undo file associations

    3
    0 Votes
    3 Posts
    3k Views
    GordyPankG

    I don’t know if you have figured this out by yourself yet, but it appears that Notepad ++ breaks several file associations (at least on my systems) that I have had to manually fix - .bat, .cmd, .ini, .inf, nfo. and .vbs. The easiest way to fix this is via the ASSOC command from the (Administrator) command prompt. The best way to check which associations need to be looked at is to run ‘assoc’ and copy-and-paste the results into (ironically) Notepad ++ and look at which ones are associated with NPP. You can get the syntax by typing ‘assoc /?’ at a prompt. The proper associations for the ones listed are:
    .bat=batfile;
    .cmd=cmdfile;
    .inf=inffile;
    .ini=inifile;
    .nfo=MSInfoFile
    .vbs=VBSFile

    It also seems to grab .bash file extensions too, but unless you have the new Bash shell on Windows 10 installed this won’t matter.

    Hope this helps!

  • Compile C# from NPP

    Locked
    7
    0 Votes
    7 Posts
    7k Views
    Jawz FerocityJ

    @Scott-Sumner said:

    Perhaps the best way to explain it so that it is understood is that instead of doing

    cmd /k csc.exe “$(C:\Users\user1\Documents\MyFiles\sample.cs)”

    You should do

    cmd /k csc.exe “C:\Users\user1\Documents\MyFiles\sample.cs”

    Make sure that works, then change it to how you really should do it, and that is, have your file – C:\Users\user1\Documents\MyFiles\sample.cs – active in an editor tab, and then invoke exactly this:

    cmd /k csc.exe “$(FULL_CURRENT_PATH)”

    TY guys I’m up and running.

  • 0 Votes
    2 Posts
    3k Views
    Claudia FrankC

    @Bryce-Gessell

    outlining is one of those terms which do have different meanings and/or assumptions what is expected,
    so please forgive me if my tip isn’t useful - what about using a regular expression and search for all in current document?

    Cheers
    Claudia

  • i want to keep only unique lines

    3
    0 Votes
    3 Posts
    17k Views
    Hà NguyễnH

    Hi Guy038 ,

    " the regexes : SEARCH = (?-s)^(.+\R)\1+ , REPLACE = EMPTY "

    i do that step ,but nothing happen ,why so ,dear

  • Installation problem

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    Angel BlooderA

    Doesn’t matter, i downloaded the dll file manually, is working now.

  • Notepad++ Plugin Disable?

    4
    0 Votes
    4 Posts
    5k Views
    Claudia FrankC

    @crogersts

    Thanks for replying, I tried the switch and no it is the same unfortunately.

    Are you sure? This switch disables the plugin manager - you still have the import
    menu but you cannot load the plugins.

    Cheers
    Claudia

  • Hello-Help with regular expressions

    3
    0 Votes
    3 Posts
    2k Views
    guy038G

    Hello, Antonio,

    If you are sure that the last colon, of each line of your file, is the exact location which separates the two parts, of each line, to be reversed , an other formulation could be :

    SEARCH : (?-s)^(.+):(.+)

    REPLACE : \2: \1 ( with a space between the colon : and the back-reference \1)

    Notes :

    The (?-s) first part ensures that the dot special character ( . ) represents a single standard character and not any End of Line character

    Then the part (.+):, look, from beginning of line ( ^ ), for the longest non-empty range of standard characters, followed by the last colon of each line, which is stored as group 1, due to round brackets

    Finally, the part (.+), grabs all the remaining standard characters of the current line ( = all text after the last colon character ) and stores them in group 2

    Best Regards,

    guy038

  • 0 Votes
    5 Posts
    2k Views
    chcgC

    Which type of installation do you use?

    Notepad++ Installer 32-bit x86: Take this one if you have no idea which one you should take.
    Notepad++ zip package 32-bit x86: Don’t want to use installer? Check this one (zip format).
    Notepad++ 7z package 32-bit x86: Don’t want to use installer? 7z format.
    Notepad++ minimalist package 32-bit x86: No theme, no plugin, no updater, quick download and play directly. 7z format.

    The autoupdater is named gup.exe under Notepad++\updater and has a corresponding config file gup.xml. Gup.xml could be modified to avoid that the update page could be found or could be removed as in the minimalist package.

    The gpup.exe in the same folder is the updater for the plugin manager.

  • 1 Votes
    3 Posts
    2k Views
    Eric GrudinE

    Ok, thanks.

  • Pasting formatted text copied from webpage in Firefox

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Claudia FrankC

    @Toni-Graham

    I’m a bit confused - does this mean you want to have the html source of that side?
    If so, right click on the page and choose view source, than copy/paste to notepad++.

    Cheers
    Claudia

  • file associations // open with

    5
    0 Votes
    5 Posts
    3k Views
    bub xyzB

    @Claudia-Frank

    Running npp as admin worked. I have never set it up that way and did not know. Thanks for your help :)

  • Regex: how to remove spaces that are not followed by letters or numbers

    12
    0 Votes
    12 Posts
    6k Views
    Js jSJ

    ouch!!

    try opening the original pdf file using Notepad++
    you may get lucky, and the contents may be cleartext (not compressed)

    otherwise, try a different pdf to txt converter or try ocr software

    good luck

  • 0 Votes
    2 Posts
    3k Views
    gstaviG

    AFAIK,
    Global Default is the basis. Usually Default Style is the only place where you select a mono space font and its size which will be used by all other styles. Language specific styles will override the Default by applying color and background but most of them do not change the font itself or its size. Sadly it seems that background is always overridden by language styler instead of using the default.
    Global Override has specific enablers that can override specific aspects for all documents regardless of language style. You can force dark background for everything but since language specific stylers will still use dark fonts you will get hard to read dark on dark and possibly even invisible black on black. I never used it.

    Respecting the windows scheme is not practical in this case since you need to use ton of different colors during syntax highlighting. Windows scheme is mainly for single color on single background. I don’t remember Visual Studio respecting it but maybe I just never tried.

    You do have several downloadable NPP schemes that are maintained with hard work.

  • Where did the "Help" / documentation go?

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied